File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,14 @@ target_compile_options(main
41
41
#Default to C++17 -- no effect on C code
42
42
target_compile_features (main PUBLIC cxx_std_17 )
43
43
44
+ #Provide option to force O3 for RelWithDebInfo
45
+ if (RELWITHDEBINFO_FORCE_OPTIMIZATION_O3 )
46
+ string (REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} " )
47
+ string (REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} " )
48
+ endif ()
49
+
44
50
#Special: handle emscripten for running in web browser
45
51
if ("${CMAKE_SYSTEM_NAME} " MATCHES "Emscripten" )
46
-
47
52
#Ensure Release builds have full optimization enabled
48
53
string (REPLACE "O2" "O3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} " )
49
54
string (REPLACE "O2" "O3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} " )
You can’t perform that action at this time.
0 commit comments