1
0
Fork 0
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:
Ferdinand Thiessen 2015-12-03 21:18:39 +01:00 committed by est31
parent 5643b9b9ed
commit 70ece71ee4
3 changed files with 67 additions and 27 deletions

View file

@ -155,8 +155,23 @@ if(ENABLE_FREETYPE)
endif()
endif(ENABLE_FREETYPE)
find_package(Lua REQUIRED)
# LuaJIT
option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
set(USE_LUAJIT FALSE)
if(ENABLE_LUAJIT)
find_package(LuaJIT)
if(LUAJIT_FOUND)
set(USE_LUAJIT TRUE)
endif(LUAJIT_FOUND)
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()
find_package(GMP REQUIRED)