Skip to content
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
Closed

CMakeCompiler Options Silently change -O3 to -O2 #8923

adishavit opened this issue Jun 15, 2017 · 3 comments

Comments

@adishavit
Copy link
Contributor

@adishavit 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
Copy link
Contributor Author

@adishavit 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
Copy link
Contributor Author

@adishavit adishavit commented Jun 19, 2017

See git "blame" here.

cc: @taka-no-me

@adishavit
Copy link
Contributor Author

@adishavit 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.