From 6bee0c08d28f1fe7a62ca99c8bee18d9138ee087 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Sat, 6 Jul 2024 01:40:22 +0900 Subject: [PATCH] windows: luajit-cmake: Handle cross compilation for minilua and buildvm correctly Signed-off-by: Hiroshi Hatake --- lib/luajit-cmake/LuaJIT.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/luajit-cmake/LuaJIT.cmake b/lib/luajit-cmake/LuaJIT.cmake index 81e61ef6914..4ad1ef565a4 100644 --- a/lib/luajit-cmake/LuaJIT.cmake +++ b/lib/luajit-cmake/LuaJIT.cmake @@ -388,13 +388,15 @@ endif() set(VM_DASC_PATH ${LJ_DIR}/vm_${DASM_ARCH}.dasc) # Build the minilua for host platform -if(NOT CMAKE_CROSSCOMPILING OR ARM64_MSVC) +if(NOT CMAKE_CROSSCOMPILING) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/host/minilua) set(MINILUA_PATH $) else() make_directory(${CMAKE_CURRENT_BINARY_DIR}/minilua) if (HOST_WINE) set(MINILUA_PATH ${CMAKE_CURRENT_BINARY_DIR}/minilua/minilua.exe) + elseif(ARM64_MSVC) + set(MINILUA_PATH ${CMAKE_CURRENT_BINARY_DIR}/minilua/Debug/minilua) else() set(MINILUA_PATH ${CMAKE_CURRENT_BINARY_DIR}/minilua/minilua) endif() @@ -469,12 +471,16 @@ if(HOST_WINE) set(BUILDVM_EXE buildvm.exe) endif() -if(NOT CMAKE_CROSSCOMPILING OR ARM64_MSVC) +if(NOT CMAKE_CROSSCOMPILING) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/host/buildvm) set(BUILDVM_PATH $) add_dependencies(buildvm buildvm_arch_h) else() - set(BUILDVM_PATH ${CMAKE_CURRENT_BINARY_DIR}/buildvm/${BUILDVM_EXE}) + if (NOT ARM64_MSVC) + set(BUILDVM_PATH ${CMAKE_CURRENT_BINARY_DIR}/buildvm/${BUILDVM_EXE}) + else() + set(BUILDVM_PATH ${CMAKE_CURRENT_BINARY_DIR}/buildvm/Debug/${BUILDVM_EXE}) + endif() make_directory(${CMAKE_CURRENT_BINARY_DIR}/buildvm)