-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMake_inc.cmake
20 lines (15 loc) · 938 Bytes
/
CMake_inc.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(GCC_RELEASE_COMPILE_FLAGS "-O3 -mavx -mfpmath=sse -ffast-math -ftree-vectorize -mfma")
set(GCC_DEBUG_COMPILE_FLAGS " -ggdb -mavx -mfpmath=sse -ffast-math -ftree-vectorize -mfma")
set (CMAKE_CXX_FLAGS_RELEASE ${GCC_RELEASE_COMPILE_FLAGS} )
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} ${GCC_RELEASE_COMPILE_FLAGS}" )
set (CMAKE_CXX_FLAGS_DEBUG ${GCC_DEBUG_COMPILE_FLAGS})
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS} ${GCC_DEBUG_COMPILE_FLAGS}" )
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
string "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()