mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Improve LuaJIT detection
On openSUSE luajit is not detected correctly. This is because openSUSE is using a lua version suffix, like other Linux distributions do it also. So the include directory is: include/luajit-5_1-2.0
This commit is contained in:
parent
5643b9b9ed
commit
70ece71ee4
3 changed files with 67 additions and 27 deletions
|
@ -1,25 +0,0 @@
|
|||
|
||||
option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
|
||||
mark_as_advanced(LUA_LIBRARY LUA_INCLUDE_DIR)
|
||||
set(USE_LUAJIT FALSE)
|
||||
|
||||
if(ENABLE_LUAJIT)
|
||||
find_library(LUA_LIBRARY luajit
|
||||
NAMES luajit-5.1)
|
||||
find_path(LUA_INCLUDE_DIR luajit.h
|
||||
NAMES luajit.h
|
||||
PATH_SUFFIXES luajit-2.0)
|
||||
if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
|
||||
set(USE_LUAJIT TRUE)
|
||||
endif()
|
||||
else()
|
||||
message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
|
||||
endif()
|
||||
|
||||
if(NOT USE_LUAJIT)
|
||||
message(STATUS "LuaJIT not found, using bundled Lua.")
|
||||
set(LUA_LIBRARY "lua")
|
||||
set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
|
||||
add_subdirectory(lua)
|
||||
endif()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue