2019-04-11 01:03:30 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(lg_common LANGUAGES C)
|
|
|
|
|
2021-03-01 00:51:54 +00:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
|
|
|
|
|
2019-04-11 01:03:30 +00:00
|
|
|
include_directories(
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
2020-08-10 06:22:02 +00:00
|
|
|
add_definitions(-D_GNU_SOURCE)
|
|
|
|
|
2019-06-18 23:13:03 +00:00
|
|
|
if(ENABLE_BACKTRACE)
|
|
|
|
add_definitions(-DENABLE_BACKTRACE)
|
|
|
|
endif()
|
|
|
|
|
2021-02-21 14:54:46 +00:00
|
|
|
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_compile_options(
|
|
|
|
"-Wno-unknown-warning-option"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-01-02 11:21:42 +00:00
|
|
|
add_subdirectory(src/platform)
|
|
|
|
|
2019-05-23 06:54:50 +00:00
|
|
|
set(COMMON_SOURCES
|
2019-05-21 01:30:57 +00:00
|
|
|
src/stringutils.c
|
2019-05-12 06:13:50 +00:00
|
|
|
src/stringlist.c
|
2019-05-09 12:06:58 +00:00
|
|
|
src/option.c
|
2019-10-01 13:17:20 +00:00
|
|
|
src/framebuffer.c
|
2020-10-12 08:43:29 +00:00
|
|
|
src/KVMFR.c
|
2021-02-11 09:01:52 +00:00
|
|
|
src/countedbuffer.c
|
2021-06-05 23:35:50 +00:00
|
|
|
src/runningavg.c
|
2019-05-09 12:06:58 +00:00
|
|
|
)
|
|
|
|
|
2020-01-02 11:21:42 +00:00
|
|
|
add_library(lg_common STATIC ${COMMON_SOURCES})
|
|
|
|
target_link_libraries(lg_common lg_common_platform)
|
2019-04-11 01:03:30 +00:00
|
|
|
|
|
|
|
target_include_directories(lg_common
|
|
|
|
INTERFACE
|
|
|
|
include
|
|
|
|
PRIVATE
|
|
|
|
src
|
|
|
|
)
|