From e0def59ac0925cbde7d2543a18e3a9e39a22161e Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 5 Jul 2024 17:58:33 +0900 Subject: [PATCH] Enabling ARM64 Windows build is only for ARM64 Windows Signed-off-by: Hiroshi Hatake --- LuaJIT.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/LuaJIT.cmake b/LuaJIT.cmake index 831d78c..451ce8e 100644 --- a/LuaJIT.cmake +++ b/LuaJIT.cmake @@ -174,13 +174,12 @@ if(WIN32 OR MINGW) set(DASM_FLAGS ${DASM_FLAGS} -D WIN) endif() -set(CROSSCOMPILING_MSVC 0) +set(ARM64_MSVC 0) if (MSVC) - if ("${LJ_DETECTED_ARCH}" STREQUAL "AArch64") - set(CROSSCOMPILING_MSVC 1) - message(STATUS "Cross compiling with MSVC: ${CROSSCOMPILING_MSVC}") - else() - message(STATUS "Cross compiling with MSVC: ${CROSSCOMPILING_MSVC}") + if ("${LJ_DETECTED_ARCH}" STREQUAL "AArch64" AND + "${MAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL ARM64) + set(ARM64_MSVC 1) + message(STATUS "Compiling for ARM64 with MSVC: ${ARM64_MSVC}") endif() endif() @@ -389,7 +388,7 @@ endif() set(VM_DASC_PATH ${LJ_DIR}/vm_${DASM_ARCH}.dasc) # Build the minilua for host platform -if(NOT CMAKE_CROSSCOMPILING OR CROSSCOMPILING_MSVC) +if(NOT CMAKE_CROSSCOMPILING OR ARM64_MSVC) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/host/minilua) set(MINILUA_PATH $) else() @@ -453,7 +452,7 @@ if(HOST_WINE) set(BUILDVM_EXE buildvm.exe) endif() -if(NOT CMAKE_CROSSCOMPILING OR CROSSCOMPILING_MSVC) +if(NOT CMAKE_CROSSCOMPILING OR ARM64_MSVC) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/host/buildvm) set(BUILDVM_PATH $) add_dependencies(buildvm buildvm_arch_h)