File: use-system-lua%2B%2B-patch

package info (click to toggle)
minetest 5.6.1%2Bdfsg%2B~1.9.0mt8%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 48,628 kB
  • sloc: cpp: 209,002; ansic: 14,537; sh: 914; java: 561; python: 303; xml: 208; makefile: 36
file content (25 lines) | stat: -rw-r--r-- 852 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Use pkgconfig to find C++ variant of Lua-5.1
 Upstream compiles lua a c++ as well, and lua is c++ aware if
 done so, so lets use the packaged c++ libraries as well.
Author: Tobias Frost <tobi@debian.org>
Forwarded: no, Debian specific.
Last-Update: 2022-09-21 <YYYY-MM-DD, last update of the meta-information, optional>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,6 +277,14 @@
 find_package(GMP REQUIRED)
 find_package(Json REQUIRED)
 find_package(Lua REQUIRED)
+
+if(NOT USE_LUAJIT)
+  include(FindPkgConfig)
+  pkg_check_modules(LUA REQUIRED lua-5.1-c++)
+  set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIRS})
+  set(LUA_LIBRARY ${LUA_LIBRARIES})
+endif()
+
 if(NOT USE_LUAJIT)
 	set(LUA_BIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/bitop)
 	set(LUA_BIT_LIBRARY bitop)