-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
47 lines (36 loc) · 1.49 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
cmake_minimum_required (VERSION 2.8.11)
project (limbo)
include (CTest)
#set (CMAKE_BUILD_TYPE Release)
set (CMAKE_BUILD_TYPE Debug)
set (CMAKE_VERBOSE_MAKEFILE ON)
# Good for YCM-Generator for the Vim YouCompleteMe plugin
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -march=native")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|GNU)")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wuninitialized -pedantic -Wno-zero-length-array")
endif ()
# Debug configuration
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_DEBUG")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_CONCEPT_CHECKS")
# defining
# -D_GLIBCXX_CONCEPT_CHECKS
# leads to compiler errors when using things like
# std::vector<std::unique_ptr<int>> asdf;
# because of missing copy assignment operators
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
endif ()
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
# Release configuration
if (CMAKE_BUILD_TYPE MATCHES Release)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif ()
add_subdirectory (src)
add_subdirectory (tests)
add_subdirectory (examples)