Fix including and linking Velopack on macOS when it isn't being used

This commit is contained in:
Hecklezz
2026-05-26 19:32:22 +10:00
parent 443cc2b4eb
commit 2d9be86c53
+31 -32
View File
@@ -7,7 +7,7 @@ include_guard()
# USE_VELOPACK controls whether to use Velopack for installer packaging (instead of NSIS/DMG)
option(USE_VELOPACK "Use Velopack for installer packaging" OFF)
if (USE_VELOPACK)
if (USE_VELOPACK) # <FS:TJ/> Only include and link Velopack if it is being used
if (WINDOWS)
include(Prebuilt)
use_prebuilt_binary(velopack)
@@ -35,36 +35,35 @@ if (USE_VELOPACK)
ntdll
)
target_compile_definitions(ll::velopack INTERFACE LL_VELOPACK=1)
elseif (DARWIN)
include(Prebuilt)
use_prebuilt_binary(velopack)
add_library(ll::velopack INTERFACE IMPORTED)
target_include_directories(ll::velopack SYSTEM INTERFACE
${LIBS_PREBUILT_DIR}/include/velopack
)
target_link_libraries(ll::velopack INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libvelopack_libc.a
)
# macOS system frameworks required by Velopack (Rust static library dependencies)
target_link_libraries(ll::velopack INTERFACE
"-framework Foundation"
"-framework Security"
"-framework SystemConfiguration"
"-framework AppKit"
"-framework CoreFoundation"
"-framework CoreServices"
"-framework IOKit"
"-liconv"
"-lresolv"
)
target_compile_definitions(ll::velopack INTERFACE LL_VELOPACK=1)
endif()
elseif (DARWIN)
include(Prebuilt)
use_prebuilt_binary(velopack)
add_library(ll::velopack INTERFACE IMPORTED)
target_include_directories(ll::velopack SYSTEM INTERFACE
${LIBS_PREBUILT_DIR}/include/velopack
)
target_link_libraries(ll::velopack INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libvelopack_libc.a
)
# macOS system frameworks required by Velopack (Rust static library dependencies)
target_link_libraries(ll::velopack INTERFACE
"-framework Foundation"
"-framework Security"
"-framework SystemConfiguration"
"-framework AppKit"
"-framework CoreFoundation"
"-framework CoreServices"
"-framework IOKit"
"-liconv"
"-lresolv"
)
target_compile_definitions(ll::velopack INTERFACE LL_VELOPACK=1)
endif()
endif() # <FS:TJ/> Only include and link Velopack if it is being used