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
Adding CMake visibility policy setting #1215
Conversation
This policy setting will silence a warning when using with a visibility settings on targets. Due to the forced `cmake_minimum_version`, policy settings in CMakeLists calling this one (including the main CMakeLists) are lost, forcing the change to be made here.
Could you please provide testing output before and after |
Sure, this is with After:
Before:(Corrected, this was an old master before, and still had the 0048 warnings which were fixed previously)
|
Looks good, just one more - how will this behave with old version of cmake? |
It ignores it, that's why it is surrounded by the if statement. See https://cmake.org/cmake/help/v3.3/manual/cmake-policies.7.html#manual:cmake-policies(7) The behavior of CMP0063 is described here: https://cmake.org/cmake/help/v3.3/policy/CMP0063.html . Setting this to OLD will still remove the warning, but will ignore the visibility settings in GoogleTest if statically linked on all CMake versions (current behavior). Set to ON will cause GoogleTest to keep it's requested visibility settings even if statically linked on CMake 3.3+. It's used in GoogleTest's code here: googletest/googletest/CMakeLists.txt Lines 59 to 62 in 1fe692c
Let me know if you'd like anything else. I really just care about the warnings, so OLD is fine, but it almost assuredly not ideal, and OLD may stop having an effect in upcoming versions of CMake. The same sort of decision was made to set CMP0048 to NEW. |
PS: I believe the Travis CI testing is with the default Trusty CMake 2.8. |
LGTM |
This policy setting will silence a warning when using with a visibility settings on targets. Due to the forced
cmake_minimum_version
, policy settings in CMakeLists calling this one (including the main CMakeLists) are lost, forcing the change to be made here.