Skip to content

Commit

Permalink
windows: luajit-cmake: Handle cross compilation for minilua and build…
Browse files Browse the repository at this point in the history
…vm correctly

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Jul 5, 2024
1 parent c60dc37 commit 6bee0c0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/luajit-cmake/LuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:minilua>)
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()
Expand Down Expand Up @@ -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 $<TARGET_FILE:buildvm>)
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)

Expand Down

0 comments on commit 6bee0c0

Please sign in to comment.