-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (29 loc) · 1.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.10)
project(libsat VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE})
set(CMAKE_GENERATOR "Ninja")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
# Enable cppcheck
find_program(CPPCHECK cppcheck)
if(CPPCHECK)
list(APPEND CMAKE_CXX_CPPCHECK "cppcheck;--enable=warning,performance;--inconclusive;--inline-suppr;--quiet")
else()
message(SEND_ERROR "cppcheck not found, cannot run static code analysis")
endif()
add_compile_options(-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls -fwrapv)
add_link_options(-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls -fwrapv)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
include(CTest)
enable_testing()
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
endif()
add_subdirectory(src)
add_subdirectory(tests)