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.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake
index 1bff020691..daf39ec271 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -3,7 +3,7 @@
# writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables
# instead of DEPS_* - check the main CMakeLists.txt for a list.
-if(MSVC)
+if(MSVC OR (MINGW AND NOT CMAKE_CROSSCOMPILING))
message(STATUS "Building busted in Windows is not supported (skipping)")
else()
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
@@ -46,11 +46,9 @@ endfunction()
set(LUAROCKS_BINARY ${HOSTDEPS_BIN_DIR}/luarocks)
# Arguments for calls to 'luarocks build'
-if(MSVC)
- # In native Win32 don't pass the compiler/linker to luarocks, the bundled
+if(NOT MSVC)
+ # In MSVC don't pass the compiler/linker to luarocks, the bundled
# version already knows, and passing them here breaks the build
- set(LUAROCKS_BUILDARGS CFLAGS=/MT)
-else()
set(LUAROCKS_BUILDARGS CC=${HOSTDEPS_C_COMPILER} LD=${HOSTDEPS_C_COMPILER})
endif()
@@ -67,8 +65,12 @@ if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
--lua-suffix=jit
INSTALL_COMMAND ${MAKE_PRG} bootstrap)
+elseif(MSVC OR MINGW)
+
+ if(MINGW)
+ set(MINGW_FLAG /MW)
+ endif()
-elseif(MSVC)
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
BuildLuarocks(INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
/LUA ${DEPS_INSTALL_DIR}
@@ -78,6 +80,7 @@ elseif(MSVC)
/P ${DEPS_INSTALL_DIR} /TREE ${DEPS_INSTALL_DIR}
/SCRIPTS ${DEPS_BIN_DIR}
/CMOD ${DEPS_BIN_DIR}
+ ${MINGW_FLAG}
/LUAMOD ${DEPS_BIN_DIR}/lua)
set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/2.2/luarocks.bat)