diff --git a/indra/cmake/Velopack.cmake b/indra/cmake/Velopack.cmake
index ebe8f3b3f4..1d7f06488c 100644
--- a/indra/cmake/Velopack.cmake
+++ b/indra/cmake/Velopack.cmake
@@ -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) # 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() # Only include and link Velopack if it is being used