Skip to content

Commit f9ce6b6

Browse files
committed
fix MSVC static library flags for ARM64 builds
1 parent 15a81f9 commit f9ce6b6

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

BLOSC/config/zlib-CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,12 @@ endif(MINGW)
148148

149149
### Define library
150150
add_library(zlibstat STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
151-
if (MSVC AND CMAKE_CL_64)
152-
set_target_properties (zlibstat PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
151+
if (MSVC)
152+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|x86_64)$")
153+
set_target_properties(${ZLIB_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
154+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
155+
set_target_properties(${ZLIB_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:ARM64")
156+
endif()
153157
endif ()
154158
set_target_properties(zlibstat PROPERTIES
155159
PUBLIC_HEADER ""

LZF/config/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ set (LZF_SRCS
146146

147147
add_library (${LZF_LIB_TARGET} STATIC ${LZF_SRCS} ${LZF_HDRS} ${LZF_PUBLIC_HEADERS})
148148

149-
if (MSVC AND CMAKE_CL_64)
150-
set_target_properties (${LZF_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
149+
if (MSVC)
150+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|x86_64)$")
151+
set_target_properties(${ZLIB_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
152+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
153+
set_target_properties(${ZLIB_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:ARM64")
154+
endif()
151155
endif ()
152156
TARGET_C_PROPERTIES (${LZF_LIB_TARGET} STATIC)
153157
target_link_libraries (${LZF_LIB_TARGET} ${H5PL_LINK_LIBS})

0 commit comments

Comments
 (0)