2019-04-11 01:03:30 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(lg_common LANGUAGES C)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
2019-06-18 23:13:03 +00:00
|
|
|
if(ENABLE_BACKTRACE)
|
|
|
|
add_definitions(-DENABLE_BACKTRACE)
|
|
|
|
endif()
|
|
|
|
|
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-05-23 06:54:50 +00:00
|
|
|
set(LINUX_SOURCES
|
|
|
|
src/crash.linux.c
|
|
|
|
src/sysinfo.linux.c
|
|
|
|
)
|
|
|
|
|
2019-05-24 11:39:51 +00:00
|
|
|
set(WINDOWS_SOURCES
|
2019-05-23 06:54:50 +00:00
|
|
|
src/crash.windows.c
|
|
|
|
src/sysinfo.windows.c
|
|
|
|
)
|
|
|
|
|
2019-04-11 01:34:22 +00:00
|
|
|
if(WIN32)
|
2019-05-23 06:54:50 +00:00
|
|
|
set(SOURCES ${COMMON_SOURCES} ${WINDOWS_SOURCES})
|
|
|
|
add_library(lg_common STATIC ${SOURCES})
|
2019-04-11 01:34:22 +00:00
|
|
|
else()
|
2019-05-23 06:54:50 +00:00
|
|
|
set(SOURCES ${COMMON_SOURCES} ${LINUX_SOURCES})
|
|
|
|
add_library(lg_common STATIC ${SOURCES})
|
2019-06-18 23:13:03 +00:00
|
|
|
if(ENABLE_BACKTRACE)
|
|
|
|
target_link_libraries(lg_common bfd)
|
|
|
|
endif()
|
2019-04-11 01:34:22 +00:00
|
|
|
endif()
|
2019-04-11 01:03:30 +00:00
|
|
|
|
|
|
|
target_include_directories(lg_common
|
|
|
|
INTERFACE
|
|
|
|
include
|
|
|
|
PRIVATE
|
|
|
|
src
|
|
|
|
)
|