LookingGlass/common/CMakeLists.txt
Geoffrey McRae 6358f35cb7 [common] detect clang and disable warnings for unknown-warning-option
Clang doesn't know the warning option `format-truncation`, which GCC
falsely triggers on when calling vsnprintf. Further to this, GCC doesn't
understand the warning group `unknown-warning-option`, as such we must
disable these warnings in the cmake.
2021-02-22 01:54:46 +11:00

40 lines
675 B
CMake

cmake_minimum_required(VERSION 3.0)
project(lg_common LANGUAGES C)
include_directories(
${PROJECT_SOURCE_DIR}/include
)
add_definitions(-D_GNU_SOURCE)
if(ENABLE_BACKTRACE)
add_definitions(-DENABLE_BACKTRACE)
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(
"-Wno-unknown-warning-option"
)
endif()
add_subdirectory(src/platform)
set(COMMON_SOURCES
src/stringutils.c
src/stringlist.c
src/option.c
src/framebuffer.c
src/KVMFR.c
src/countedbuffer.c
)
add_library(lg_common STATIC ${COMMON_SOURCES})
target_link_libraries(lg_common lg_common_platform)
target_include_directories(lg_common
INTERFACE
include
PRIVATE
src
)