Cmake: Rewrite build and use inherited dependencies (#12)

This commit is contained in:
Kargatum
2019-04-03 12:32:07 +07:00
committed by GitHub
parent 23c29f010c
commit e27b9e0d89
7 changed files with 50 additions and 56 deletions

View File

@@ -4,16 +4,25 @@
# Please see the included DOCS/LICENSE.md for more information
#
file(GLOB sources *.c)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/lua.c)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/luac.c)
set(lua_STAT_SRCS
${sources}
)
include_directories(
CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR}
)
PRIVATE_SOURCES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/Debugging
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
add_library(lualib STATIC ${lua_STAT_SRCS})
list(REMOVE_ITEM PRIVATE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/lua.c)
list(REMOVE_ITEM PRIVATE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/luac.c)
add_library(lualib STATIC
${PRIVATE_SOURCES})
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES)
target_include_directories(lualib
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})