]> OCCT Git - occt.git/commitdiff
Configuration - Update optimization flag to O3 #132
authordpasukhi <dpasukhi@opencascade.com>
Wed, 30 Oct 2024 09:27:58 +0000 (09:27 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Wed, 30 Oct 2024 09:27:58 +0000 (09:27 +0000)
By Default CMake was used O3 in release mode.
It means on production mode we override from O3 to O2.

adm/cmake/occt_defs_flags.cmake

index 974f9784dd4043ae375b360f53ebbd9b4116b209..a477a3942993f60d2177a78987321427214d61b9 100644 (file)
@@ -147,8 +147,8 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
     # /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
     # /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
     # /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fomit-frame-pointer -flto -ffunction-sections")
-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -fomit-frame-pointer -flto -ffunction-sections")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
+    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
 
     # Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
     set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")