0031677: Configuration - Allow Optimization Level O3 When Compiling With G++
authorBenjamin Bihler <benjamin.bihler@compositence.de>
Tue, 21 Jul 2020 09:39:52 +0000 (11:39 +0200)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Jul 2020 13:08:22 +0000 (16:08 +0300)
Removed suppression of optimization level O3 with using Mingw64.

adm/cmake/occt_defs_flags.cmake

index 0ed941e..1b66135 100644 (file)
@@ -123,16 +123,6 @@ if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
   # Optimize size of binaries
   set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
 elseif(MINGW)
-  # Set default release optimization option to O2 instead of O3, since in
-  # some OCCT related examples, this gives significantly smaller binaries
-  # at comparable performace with MinGW-w64.
-  string (REGEX MATCH "-O3" IS_O3_CXX "${CMAKE_CXX_FLAGS_RELEASE}")
-  if (IS_O3_CXX)
-    string (REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-  else()
-    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
-  endif()
-
   add_definitions(-D_WIN32_WINNT=0x0501)
   # workaround bugs in mingw with vtable export
   set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")