Skip to content
Permalink
Browse files

Added optimization flag -O2 for GCC debug builds

  • Loading branch information
9EOR9 committed Sep 4, 2019
1 parent 0c29493 commit f0432c98c97967ac31eff53fda2df48f521f86c2
Showing with 4 additions and 0 deletions.
  1. +4 −0 CMakeLists.txt
@@ -135,7 +135,11 @@ SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")


IF(CMAKE_COMPILER_IS_GNUCC)
#Turn on optimization for debug builds
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
INCLUDE(CheckCCompilerFlag)
SET(GCC_FLAGS -Wunused -Wlogical-op -Wno-uninitialized -Wall -Wextra -Wformat-security -Wno-init-self -Wwrite-strings -Wshift-count-overflow -Wdeclaration-after-statement -Wno-undef -Wno-unknown-pragmas)
FOREACH(GCC_FLAG ${GCC_FLAGS})

0 comments on commit f0432c9

Please sign in to comment.
You can’t perform that action at this time.