aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <rpm@fthiessen.de>2015-12-03 21:18:39 +0100
committerest31 <MTest31@outlook.com>2015-12-05 23:31:09 +0100
commit70ece71ee4e8f8bff5cbc572710c0fa6fc3b355f (patch)
tree3ae8a0950287f694fe9c61a673b418a04b435791 /src
parent5643b9b9ed3ec39f90e3a7c9bf09bc255e0bcef3 (diff)
downloadminetest-70ece71ee4e8f8bff5cbc572710c0fa6fc3b355f.tar.gz
minetest-70ece71ee4e8f8bff5cbc572710c0fa6fc3b355f.tar.bz2
minetest-70ece71ee4e8f8bff5cbc572710c0fa6fc3b355f.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dfbd2f5d8..6256a8504 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)