-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
67 lines (53 loc) · 1.91 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(TASTE-Linux-Drivers VERSION 1.0.0 LANGUAGES C CXX)
set(CMAKE_C_STANDARD 99)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/lib)
set(TESTS_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/tests)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(MessageColors)
include(LoggingHelper)
add_library(common_build_options INTERFACE)
include(CommonBuildOptions)
include(Sanitizers)
option(TASTE_LINUX_DRIVERS_WARNINGS_AS_ERRORS
"Treat compiler wargnings as errors"
TRUE)
if(TASTE_LINUX_DRIVERS_WARNINGS_AS_ERRORS)
log_option_enabled("warnings as errors")
set(CLANG_WARNINGS -Werror)
endif()
set(CLANG_WARNINGS ${CLANG_WARNINGS}
-Wall
-Wextra
-Wpedantic
-Wshadow
-Wcast-align
-Wunused
-Wsign-conversion
-Wnull-dereference
-Wdouble-promotion
-Wformat=2)
set(GCC_WARNINGS ${CLANG_WARNINGS}
-Wmisleading-indentation
-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op)
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(PROJECT_WARNINGS ${GCC_WARNINGS})
endif()
target_compile_options(common_build_options INTERFACE ${PROJECT_WARNINGS})
find_package(Threads REQUIRED)
include(CppCheck)
include(ClangTidy)
include(ClangFormat)
include(Doxygen)
add_subdirectory(TASTE-Linux-Runtime/src)
add_subdirectory(TASTE-Runtime-Common/src/RuntimeMocks)
add_subdirectory(TASTE-Runtime-Common/src/Packetizer)
add_subdirectory(TASTE-Runtime-Common/src/Broker)
add_subdirectory(TASTE-Runtime-Common/src/Escaper)
add_subdirectory(src)