File tree Expand file tree Collapse file tree 2 files changed +0
-39
lines changed
Expand file tree Collapse file tree 2 files changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -53,41 +53,3 @@ macro(set_compiler_booleans)
5353 set (EXPECTED_COMPILER ON )
5454 endif ()
5555endmacro ()
56-
57- # @brief Set the default optimization flags in case the user didn't
58- # explicitly choose it with -DCMAKE_CXX_FLAGS
59- macro (set_optimization_flags )
60- set (OPTIMIZATION_FLAG_IS_SET OFF )
61- if (CMAKE_CXX_FLAGS )
62- set (OPT_FLAGS /O1 /O2 /Ob /Od /Og /Oi /Os /Ot /Ox /Oy /favor -O0 -O1 -O -O2 -O3 -Os -Ofast -Og)
63- string (REPLACE " " ";" CMAKE_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS} )
64- foreach (FLAG ${CMAKE_CXX_FLAGS_LIST} )
65- if (${FLAG} IN_LIST OPT_FLAGS)
66- message ("CXX optimization flag is already set to ${FLAG} " )
67- set (OPTIMIZATION_FLAG_IS_SET ON )
68- endif ()
69- endforeach ()
70- endif ()
71-
72- if (NOT OPTIMIZATION_FLAG_IS_SET)
73- if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
74- if (EMSCRIPTEN)
75- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g4" )
76- elseif (MSVC )
77- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O0" )
78- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
79- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0" )
80- else ()
81- # https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
82- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0" )
83- endif ()
84- else ()
85- if (MSVC )
86- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2" )
87- else ()
88- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
89- endif ()
90- endif ()
91- message ("Setting CXX flags to default for ${CMAKE_BUILD_TYPE} mode (${CMAKE_CXX_FLAGS} )" )
92- endif ()
93- endmacro ()
Original file line number Diff line number Diff line change 1111include (cmake/functions/all.cmake )
1212set_master_project_booleans ()
1313set_debug_booleans ()
14- set_optimization_flags ()
1514set_compiler_booleans ()
1615
1716#######################################################
You can’t perform that action at this time.
0 commit comments