Skip to content

Commit

Permalink
upate options for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Dec 14, 2017
1 parent 05cd09e commit dad2b7a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down

0 comments on commit dad2b7a

Please sign in to comment.