-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
29 lines (25 loc) · 954 Bytes
/
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
# Information cmake
cmake_minimum_required(VERSION 3.0.2)
# Information projec
project(model_cpp VERSION 0.1 LANGUAGES CXX)
set(LIB_MAJOR_VERSION "0")
set(LIB_MINOR_VERSION "1")
set(LIB_PATCH_VERSION "0")
set(FLAGS_OPTIMIZATIONS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
# add subdirectory
add_subdirectory( sources/ )
# set flags
set(CMAKE_CXX_FLAGS "-O2 -Os") # default flags
if(FLAGS_OPTIMIZATIONS)
set(CMAKE_CXX_FLAGS "-ftree-vectorize -mavx -fno-stack-protector -march=native -O2 -Os -fdelete-null-pointer-checks -fdelete-dead-exceptions")
elseif(FLAGS_DEBUG)
set(CMAKE_CXX_FLAGS "-fsanitize=address -fms-extensions --all-warnings -DDEBUG -g -O2 -Os -Wvolatile -Warray-bounds --extra-warnings")
endif()