-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (40 loc) · 1.27 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
cmake_minimum_required(VERSION 2.8)
project(goodie)
option(sanitize "Select sanitizer (address,memory,thread,...)" OFF)
if(UNIX)
option(enable_libc++ "Enable looking for LLVM's libc++ and using it as standard library if found")
endif(UNIX)
set(LIBS ${LIBS})
if(UNIX)
if(enable_libc++)
message("--> Looking for libc++ and libc++abi ...")
find_library(libcpp_abi c++abi)
if(libcpp_abi)
message("libc++ found: ${libcpp_abi}")
set(LIBS ${LIBS} ${libcpp_abi} -stdlib=libc++)
add_definitions(-stdlib=libc++)
else(libcpp_abi)
message("libc++ not found, falling back to libstdc++")
endif(libcpp_abi)
else(enable_libc++)
message("--> Using libstdc++ as standard library")
endif(enable_libc++)
endif(UNIX)
include_directories(include)
add_definitions(-std=c++11
-Wall
-Werror
-g
-fPIC
)
if(sanitize)
message("--> Sanitize: ${sanitize}")
list(APPEND LIBS -fsanitize=${sanitize})
add_definitions(-fsanitize=${sanitize})
else(sanitize)
message("--> Sanitizing is disabled.")
endif(sanitize)
add_subdirectory(src)
add_subdirectory(test)
## Install section
install(DIRECTORY include DESTINATION .)