mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Add extra check in case someone tries to unbundle Lua
This commit is contained in:
parent
cb725a4555
commit
558cbd89fb
@ -673,6 +673,22 @@ endif()
|
|||||||
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
if(NOT USE_LUAJIT)
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${LUA_INCLUDE_DIR})
|
||||||
|
unset(HAVE_ATCCALL CACHE)
|
||||||
|
# Note: we need to check the function without having the library
|
||||||
|
# available for linking, so check_symbol_exists won't work.
|
||||||
|
check_c_source_compiles("#include <lua.h>\nint main(){return sizeof(lua_atccall);}" HAVE_ATCCALL)
|
||||||
|
if(NOT HAVE_ATCCALL)
|
||||||
|
string(CONCAT explanation_msg
|
||||||
|
"It looks like you're trying to build Minetest using a system-wide "
|
||||||
|
"Lua installation. This is no longer supported because PUC Lua "
|
||||||
|
"cannot interoperate with C++ correctly. Read src/unittest/test_lua.cpp "
|
||||||
|
" for technical details.")
|
||||||
|
message(FATAL_ERROR ${explanation_msg})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Visual Studio
|
# Visual Studio
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D WIN32_LEAN_AND_MEAN")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D WIN32_LEAN_AND_MEAN")
|
||||||
|
Loading…
Reference in New Issue
Block a user