Skip to content

Commit 6c4c5ed

Browse files
committed
rockspec: define directories with headers and lib
Sometimes one need to compile a luzer module with a non-system Lua library and headers, for which the LUA_LIBRARIES and LUA_INCLUDE_DIR CMake options are used. The patch adds variables for the rockspec to set these options via environment variables: LUA_LIBRARIES and LUA_INCLUDE_DIR. Needed for google/oss-fuzz#14610
1 parent 7c46630 commit 6c4c5ed

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ endif()
1616
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1717
include(SetClangRTLib)
1818

19+
if(NOT "${CMAKE_LUA_LIBRARIES}" STREQUAL "")
20+
set(LUA_LIBRARIES "${CMAKE_LUA_LIBRARIES}")
21+
endif()
22+
if(NOT "${CMAKE_LUA_INCLUDE_DIR}" STREQUAL "")
23+
set(LUA_INCLUDE_DIR "${CMAKE_LUA_INCLUDE_DIR}")
24+
endif()
25+
1926
if(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
2027
# When a path to a Lua library is passed outside, we should
2128
# mimic a real CMake library to don't break code that depends on

luzer-scm-1.rockspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ build = {
2626
-- https://github.com/luarocks/luarocks/blob/7ed653f010671b3a7245be9adcc70068c049ef68/docs/config_file_format.md#config-file-format
2727
-- luacheck: pop
2828
variables = {
29+
CMAKE_LUA_INCLUDE_DIR = "$(LUA_INCLUDE_DIR)",
30+
CMAKE_LUA_LIBRARIES = "$(LUA_LIBRARIES)",
2931
CMAKE_LUADIR = "$(LUADIR)",
3032
CMAKE_LIBDIR = "$(LIBDIR)",
3133
CMAKE_BUILD_TYPE = "RelWithDebInfo",

0 commit comments

Comments
 (0)