Fixing build for windows arm64

This commit is contained in:
Honeybunch 2022-06-15 19:07:41 -07:00
parent f2712f4a8f
commit d295043ecf
2 changed files with 15 additions and 12 deletions

View file

@ -305,6 +305,8 @@ if(MI_BUILD_SHARED)
$<INSTALL_INTERFACE:${mi_install_incdir}>
)
if(WIN32)
# Until the redirect lib has a version for arm don't try to copy it
if(NOT MSVC_C_ARCHITECTURE_ID MATCHES "ARM")
# On windows copy the mimalloc redirection dll too.
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(MIMALLOC_REDIRECT_SUFFIX "32")
@ -318,6 +320,7 @@ if(MI_BUILD_SHARED)
COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory")
install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir})
endif()
endif()
install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY)
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})

View file

@ -490,7 +490,7 @@ mi_decl_nodiscard bool mi_is_redirected(void) mi_attr_noexcept {
}
// Communicate with the redirection module on Windows
#if defined(_WIN32) && defined(MI_SHARED_LIB)
#if defined(_WIN32) && defined(MI_SHARED_LIB) && !(defined(_M_ARM) || defined(_M_ARM64))
#ifdef __cplusplus
extern "C" {
#endif