-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
71 lines (57 loc) · 1.07 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
68
69
70
71
cmake_minimum_required (VERSION 3.0.2)
project (UniversalStackTrace VERSION 0.0.1)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH})
FIND_PACKAGE(Sanitizers)
# Enable C++-17
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17")
# Enable debug info
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
IF(APPLE)
# Turn off address randomizing to get debug prints
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-pie")
ENDIF()
include_directories(
external
ust
)
IF(MINGW)
SET(
CORE_LIBRARIES
dbghelp
)
ELSEIF(WIN32)
SET(
CORE_LIBRARIES
Shlwapi
dbghelp
)
ELSEIF(APPLE)
SET(
CORE_LIBRARIES
System
)
ELSE()
find_package(Libunwind)
if(LIBUNWIND_FOUND)
SET(
CORE_LIBRARIES
${LIBUNWIND_LIBRARIES}
)
ENDIF()
ENDIF()
add_executable(
ust-test
test/Main.cpp
test/BasicTest.cpp
)
target_link_libraries(
ust-test
${CORE_LIBRARIES}
)
add_test(
ust-test
ust-test
)
add_sanitizers(ust-test)