Fix broken cross-compiling

This commit is contained in:
Sfan5 2014-02-16 08:07:57 +01:00
parent c163859057
commit 4585fba98b

@ -217,6 +217,10 @@ endif (NOT DISABLE_LUAJIT)
set(USE_LUAJIT 0)
if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
message (STATUS "LuaJIT found, checking for broken versions...")
if(CMAKE_CROSSCOMPILING)
message(WARNING "Cross-compiling enabled, assuming LuaJIT is not broken")
set(VALID_LUAJIT_VERSION 1)
elseif(CMAKE_CROSSCOMPILING)
set(BACKUP_REQUIRED_INCS CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${LUA_INCLUDE_DIR}")
CHECK_C_SOURCE_RUNS("
@ -245,6 +249,7 @@ if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
"
VALID_LUAJIT_VERSION)
set(CMAKE_REQUIRED_INCLUDES BACKUP_REQUIRED_INCS)
endif(CMAKE_CROSSCOMPILING)
if (VALID_LUAJIT_VERSION)
message (STATUS "LuaJIT version ok")
set(USE_LUAJIT 1)