Skip to content

Commit e117752

Browse files
Detect ARM64 for WiX CPACK_WIX_ARCHITECTURE
Previously CPACK_WIX_ARCHITECTURE was hard-coded to x64. This change checks CMAKE_SYSTEM_PROCESSOR and sets CPACK_WIX_ARCHITECTURE to arm64 when building on ARM64, falling back to x64 otherwise. Enables correct WiX installer architecture for ARM64 Windows builds.
1 parent 79f9060 commit e117752

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/packaging/windows_wix.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ file(RENAME "${CMAKE_BINARY_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/LICENSE.txt")
8585
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.txt") # cpack will covert this to an RTF if it is txt
8686

8787
# https://cmake.org/cmake/help/latest/cpack_gen/wix.html#variable:CPACK_WIX_ARCHITECTURE
88-
set(CPACK_WIX_ARCHITECTURE "x64")
88+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64")
89+
set(CPACK_WIX_ARCHITECTURE "arm64")
90+
else()
91+
set(CPACK_WIX_ARCHITECTURE "x64")
92+
endif()

0 commit comments

Comments
 (0)