We only have to define the universal CXX flags once.
This commit is contained in:
parent
b66755174f
commit
7d6ed15523
@ -16,17 +16,23 @@ set(CMAKE_MODULE_PATH
|
|||||||
find_package(OpenMP REQUIRED)
|
find_package(OpenMP REQUIRED)
|
||||||
find_package(GMP REQUIRED)
|
find_package(GMP REQUIRED)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${GMP_INCLUDE_DIR})
|
||||||
|
|
||||||
set(SRCS
|
set(SRCS
|
||||||
src/Main.cpp)
|
src/Main.cpp)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++11 ${OpenMP_CXX_FLAGS} -fno-elide-constructors -pedantic-errors -Wall -Wextra -Werror -Wpedantic -Winit-self -Wmissing-declarations -Wuninitialized -Wfatal-errors")
|
set(CMAKE_CXX_FLAGS "-std=c++11 ${OpenMP_CXX_FLAGS} -fno-elide-constructors -pedantic-errors -Wall -Wextra -Werror -Wpedantic -Winit-self -Wmissing-declarations -Wuninitialized -Wfatal-errors")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -O0")
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -g -O3")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3")
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -Os")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug AND NOT CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
if(NOT CMAKE_BUILD_TYPE MATCHES Debug AND NOT CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${TARGET_NAME} ${SRCS})
|
add_executable(${TARGET_NAME} ${SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(${TARGET_NAME}
|
||||||
|
${GMP_LIBRARY})
|
||||||
|
Loading…
Reference in New Issue
Block a user