New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeCompiler Options Silently change -O3 to -O2 #8923

Closed
adishavit opened this Issue Jun 15, 2017 · 3 comments

Comments

2 participants
@adishavit
Contributor

adishavit commented Jun 15, 2017

On certain platforms, OpenCVCompilerOptions.cmake changes optimization flag -O3 to -O2.

This might have been important 5 years ago. s is still required?
It was originally supposed to be just for 32-bit MINGW, but that check is gone.

Specifically, it prevents -O3 when building OpenCV with emscripten, which may significantly reduce the optimizations. It's possible to just check for NOT EMSCRIPTEN but it may be worth reconsidering this whole silent change as it may not be relevant anymore.

@adishavit

This comment has been minimized.

Show comment
Hide comment
@adishavit

adishavit Jun 15, 2017

Contributor

This is especially strange since OpenCVDetectCXXCompiler.cmake has the following lines:

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  set(CMAKE_COMPILER_IS_GNUCXX 1)
  set(CMAKE_COMPILER_IS_CLANGCXX 1)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
  set(CMAKE_COMPILER_IS_GNUCC 1)
  set(CMAKE_COMPILER_IS_CLANGCC 1)
endif()

So if it's Clang it sets it also to be gcc!

Contributor

adishavit commented Jun 15, 2017

This is especially strange since OpenCVDetectCXXCompiler.cmake has the following lines:

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  set(CMAKE_COMPILER_IS_GNUCXX 1)
  set(CMAKE_COMPILER_IS_CLANGCXX 1)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
  set(CMAKE_COMPILER_IS_GNUCC 1)
  set(CMAKE_COMPILER_IS_CLANGCC 1)
endif()

So if it's Clang it sets it also to be gcc!

@adishavit

This comment has been minimized.

Show comment
Hide comment
@adishavit

adishavit Jun 19, 2017

Contributor

See git "blame" here.

cc: @taka-no-me

Contributor

adishavit commented Jun 19, 2017

See git "blame" here.

cc: @taka-no-me

@adishavit

This comment has been minimized.

Show comment
Hide comment
@adishavit

adishavit Nov 26, 2017

Contributor

Apparently resolved by #10073.

Contributor

adishavit commented Nov 26, 2017

Apparently resolved by #10073.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment