File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,17 @@ endmacro()
50
50
# @brief Set the default optimization flags in case the user didn't
51
51
# explicitly choose it with -DCMAKE_CXX_FLAGS
52
52
macro (set_optimization_flags )
53
- set (OPT_FLAGS /O1 /O2 /Ob /Od /Og /Oi /Os /Ot /Ox /Oy /favor -O0 -O1 -O -O2 -O3 -Os -Ofast -Og )
54
53
set (OPTIMIZATION_FLAG_IS_SET OFF )
55
- string (REPLACE " " ";" CMAKE_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS} )
56
- foreach (FLAG ${CMAKE_CXX_FLAGS_LIST} )
57
- if (${FLAG} IN_LIST OPT_FLAGS )
58
- message ("CXX optimization flag is already set to ${FLAG} " )
59
- set (OPTIMIZATION_FLAG_IS_SET ON )
60
- endif ()
61
- endforeach ()
54
+ if (CMAKE_CXX_FLAGS )
55
+ set (OPT_FLAGS /O1 /O2 /Ob /Od /Og /Oi /Os /Ot /Ox /Oy /favor -O0 -O1 -O -O2 -O3 -Os -Ofast -Og )
56
+ string (REPLACE " " ";" CMAKE_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS} )
57
+ foreach (FLAG ${CMAKE_CXX_FLAGS_LIST} )
58
+ if (${FLAG} IN_LIST OPT_FLAGS )
59
+ message ("CXX optimization flag is already set to ${FLAG} " )
60
+ set (OPTIMIZATION_FLAG_IS_SET ON )
61
+ endif ()
62
+ endforeach ()
63
+ endif ()
62
64
63
65
if (NOT OPTIMIZATION_FLAG_IS_SET )
64
66
if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
You can’t perform that action at this time.
0 commit comments