Skip to content

Commit

Permalink
luajit-cmake: build: Avoid to use INCLUDE_DIRECTORIES property
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Jul 5, 2024
1 parent fa7655a commit a1c5d79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmake/luajit.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# luajit cmake
option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" ON)
option(LUAJIT_SETUP_INCLUDE_DIR "Setup include dir if parent is present" OFF)
set(LUAJIT_DIR ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT})
add_subdirectory("lib/luajit-cmake")
13 changes: 9 additions & 4 deletions lib/luajit-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5)

option(LUA_DIR "Path of Lua 5.4 source dir" OFF)
option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" OFF)
option(LUAJIT_SETUP_INCLUDE_DIR "Setup include dir if parent is present" ON)

if(CMAKE_COMPILER_IS_GNUCC)
set(LUA_TARGET_SHARED ON)
Expand All @@ -17,17 +18,21 @@ if(LUAJIT_DIR)
if (hasParent)
set(LUA_TARGET $<TARGET_FILE:luajit> PARENT_SCOPE)
set(LUA_LIBRARIES luajit::lib PARENT_SCOPE)
get_target_property(LUA_INCLUDE_DIR luajit::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
if (LUAJIT_SETUP_INCLUDE_DIR)
get_target_property(LUA_INCLUDE_DIR luajit::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
endif()
endif()
elseif(LUA_DIR)
project(lua)
include(lua.cmake)
if (hasParent)
set(LUA_TARGET $<TARGET_FILE:lua> PARENT_SCOPE)
set(LUA_LIBRARIES lua::lib PARENT_SCOPE)
get_target_property(LUA_INCLUDE_DIR lua::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
if (LUAJIT_SETUP_INCLUDE_DIR)
get_target_property(LUA_INCLUDE_DIR lua::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
endif()
endif()
if (WITH_LIBFFI)
include(ffi.cmake)
Expand Down

0 comments on commit a1c5d79

Please sign in to comment.