-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (52 loc) · 1.55 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
cmake_minimum_required(VERSION 2.8)
project(mjkgb C CXX)
enable_testing()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake"
)
include(EnableCXX11)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
endif()
# Turn off a lot of warnings, some are overly pedantic, some are valid but flag LLVM code
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(EXTRA_CXX_FLAGS
"-Werror"
"-Weverything"
"-Wno-conversion"
"-Wno-covered-switch-default"
"-Wno-exit-time-destructors"
"-Wno-padded"
"-Wno-shadow"
"-Wno-unused-function"
"-Wno-unused-parameter"
"-Wno-unused-label"
"-Wno-unused-value"
"-Wno-unused-variable"
"-Wno-used-but-marked-unused"
"-Wno-global-constructors"
"-Wno-missing-braces"
"-Wno-missing-noreturn"
"-Wno-missing-prototypes"
"-Wno-shorten-64-to-32"
"-Wno-switch-enum"
"-Wno-c++11-extensions"
"-Wno-c++98-compat"
"-Wno-c++98-compat-pedantic"
"-Wno-shift-sign-overflow"
"-Wno-sign-conversion"
"-Wno-gnu-label-as-value")
foreach(flag ${EXTRA_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endforeach()
else()
message(WARNING "C++ compiler is not clang, unsupported configuration")
endif()
add_subdirectory(libmjkgb)
add_subdirectory(tests)
include_directories(./libmjkgb/include)
add_executable(mjkgb
./src/main.cpp
)
target_link_libraries(mjkgb libmjkgb)