aboutsummaryrefslogtreecommitdiff
path: root/third-party/cmake/BuildLuarocks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'third-party/cmake/BuildLuarocks.cmake')
-rw-r--r--third-party/cmake/BuildLuarocks.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake
index 98783d533e..244d1d9fb8 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -56,7 +56,7 @@ endif()
# Defaults to 5.1 for bundled LuaJIT/Lua.
set(LUA_VERSION "5.1")
-if(UNIX)
+if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
if(USE_BUNDLED_LUAJIT)
list(APPEND LUAROCKS_OPTS
@@ -94,9 +94,13 @@ if(UNIX)
CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
-elseif(MSVC)
+elseif(MSVC OR MINGW)
- set(COMPILER_FLAG /MSVC)
+ if(MINGW)
+ set(COMPILER_FLAG /MW)
+ elseif(MSVC)
+ set(COMPILER_FLAG /MSVC)
+ endif()
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
BuildLuarocks(INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
@@ -119,6 +123,9 @@ list(APPEND THIRD_PARTY_DEPS luarocks)
if(USE_BUNDLED_LUAJIT)
add_dependencies(luarocks luajit)
+ if(MINGW AND CMAKE_CROSSCOMPILING)
+ add_dependencies(luarocks luajit_host)
+ endif()
elseif(USE_BUNDLED_LUA)
add_dependencies(luarocks lua)
endif()
@@ -189,6 +196,9 @@ if(USE_BUNDLED_BUSTED)
set(LUV_DEPS luacheck)
if(USE_BUNDLED_LUV)
list(APPEND LUV_DEPS luv-static lua-compat-5.3)
+ if(MINGW AND CMAKE_CROSSCOMPILING)
+ list(APPEND LUV_DEPS libuv_host)
+ endif()
set(LUV_ARGS "CFLAGS=-O0 -g3 -fPIC")
if(USE_BUNDLED_LIBUV)
list(APPEND LUV_ARGS LIBUV_DIR=${HOSTDEPS_INSTALL_DIR})