From dad2b7a870e2b4718608ecb3e70a9cfb9438b004 Mon Sep 17 00:00:00 2001 From: Nick Sharp Date: Thu, 14 Dec 2017 12:21:02 -0500 Subject: [PATCH] upate options for gcc --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad5452f4..16b6645a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,14 +16,21 @@ set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) # Emit a compile flags file to support co if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # using Clang (linux or apple) or GCC message("Using clang/gcc compiler flags") - SET(BASE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Werror -g3 -ferror-limit=5 -fcolor-diagnostics") + SET(BASE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Werror -g3") SET(DISABLED_WARNINGS " -Wno-unused-parameter -Wno-unused-variable -Wno-unused-private-field -Wno-unused-function -Wno-deprecated-declarations") SET(TRACE_INCLUDES " -H -Wno-error=unused-command-line-argument") + + # clang-specific things + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + SET(BASE_CXX_FLAGS "${BASE_CXX_FLAGS} -ferror-limit=5 -fcolor-diagnostics") + endif() + + SET(CMAKE_CXX_FLAGS "${BASE_CXX_FLAGS} ${DISABLED_WARNINGS}") #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TRACE_INCLUDES}") # uncomment if you need to track down where something is getting included from SET(CMAKE_CXX_FLAGS_DEBUG "-g3") SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") - SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") + SET(CMAKE_CXX_FLAGS_RELEASE "-march=native -O3 -DNDEBUG") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # using Visual Studio C++