Skip to content

Commit

Permalink
Use lua from submodule if possible
Browse files Browse the repository at this point in the history
Signed-off-by: Jarosław Pelczar <[email protected]>
  • Loading branch information
jarekpelczar committed Jun 30, 2024
1 parent eccb1f1 commit 78fd453
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@ find_package(PkgConfig)
find_package(Lua)

if(NOT LUA_FOUND)
cpmaddpackage(
NAME
lua
GIT_REPOSITORY
https://github.com/lua/lua.git
VERSION
5.4
DOWNLOAD_ONLY
YES)

file(GLOB lua_sources ${lua_SOURCE_DIR}/onelua.c)
if(EXISTS external/lua/onelua.c)
set(lua_sources external/lua/onelua.c)
else()
cpmaddpackage(
NAME
lua
GIT_REPOSITORY
https://github.com/lua/lua.git
VERSION
5.4
DOWNLOAD_ONLY
YES)

file(GLOB lua_sources ${lua_SOURCE_DIR}/onelua.c)
endif()

add_library(lua_import STATIC ${lua_sources})
target_include_directories(lua_import SYSTEM
PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
Expand Down

0 comments on commit 78fd453

Please sign in to comment.