-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (31 loc) · 1.28 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
cmake_minimum_required(VERSION 3.0)
project(craftpp)
set(CMAKE_CXX_STANDARD 20)
option(CODE_COVERAGE "Enable coverage reporting" OFF)
option(ADDRESS_SANITIZER "Enable address sanitizer" OFF)
set(freewebrtc_VERSION_MAJOR 1)
set(freewebrtc_VERSION_MINOR 0)
add_compile_options(-Werror -Wall -Wunused-variable -Wunused-parameter -pedantic)
if(ADDRESS_SANITIZER)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")
endif()
endif()
if(CODE_COVERAGE)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-instr-generate -fcoverage-mapping")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-instr-generate -fcoverage-mapping")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -O0 -fprofile-instr-generate -fcoverage-mapping")
endif()
endif()
add_subdirectory(craftpp)
target_include_directories(craftpp PRIVATE ${CMAKE_SOURCE_DIR})
install(TARGETS craftpp
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
# Add tests
enable_testing()
add_subdirectory(tests)