Skip to content

Commit

Permalink
Merge pull request opencv#10073 from alalek:cmake_fix_overiding_compi…
Browse files Browse the repository at this point in the history
…le_options
  • Loading branch information
alalek committed Nov 13, 2017
2 parents 42f4498 + 43e4e1b commit ba940de
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions cmake/OpenCVCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ if((CMAKE_COMPILER_IS_CLANGCXX OR CMAKE_COMPILER_IS_CLANGCC OR CMAKE_COMPILER_IS
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
endif()

if(MINGW OR (X86 AND UNIX AND NOT APPLE))
# mingw compiler is known to produce unstable SSE code with -O3 hence we are trying to use -O2 instead
if(CMAKE_COMPILER_IS_GNUCXX)
foreach(flags
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG
CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG)
string(REPLACE "-O3" "-O2" ${flags} "${${flags}}")
endforeach()
endif()
endif()

if(MSVC)
string(STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
string(STRIP "${CMAKE_CXX_FLAGS_INIT}" CMAKE_CXX_FLAGS_INIT)
Expand Down

0 comments on commit ba940de

Please sign in to comment.