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

add CMP0063 policy #101

Merged
merged 2 commits into from
Oct 12, 2023
Merged

add CMP0063 policy #101

merged 2 commits into from
Oct 12, 2023

Conversation

etodanik
Copy link
Contributor

3.27.7 started actively warning if CMP0063 isn't set, which pollutes a project depending on plibsys with a lot of warnings.

@saprykin
Copy link
Owner

Could you please provide conditions under which you get these warnings? Operating system and compiler with versions, and CMake options you use to configure?

@etodanik
Copy link
Contributor Author

etodanik commented Oct 11, 2023

Any OS, compiler doesn't matter as it's a CMake issue, CMake 3.27.7:
https://cmake.org/cmake/help/latest/policy/CMP0063.html

It will show a warning any time the policy isn't set.

@saprykin
Copy link
Owner

Just checked it on macOS with clang 14 and gcc 12, CMake 3.27.7, no warnings in both cases. Do you change visibility properties of any targets?

@etodanik
Copy link
Contributor Author

etodanik commented Oct 11, 2023 via email

@saprykin
Copy link
Owner

If you use plibsys as a dependency (sub project) and vary global visibility settings, why don’t you set this policy at the top level as well? Policies should propagate to sub projects in CMake. The only reason for a top-level policy being not propagated could be minimum CMake version < 3.3 specified. Let me check this case.

@etodanik
Copy link
Contributor Author

etodanik commented Oct 11, 2023 via email

@saprykin
Copy link
Owner

How do you include plibsys as dependency and which version/commit of plibsys do you use? Policy CMP0063 was introduced back in CMake 3.3, and it warns since then (not only since 3.27.7). However, top-level CMakeLists.txt of plibsys contains the following line:
cmake_minimum_required (VERSION 2.8.0...3.25.1)
This directive already sets CMP0063 policy to NEW, as well as others. Hence, it cannot produce warnings unless you lower minimum required CMake below 3.3. In case required CMake is below 3.3 and global visibility settings are modified through, i.e. CMAKE_C_VISIBILITY_PRESET variable, then I'm able to reproduce the warnings.

@saprykin
Copy link
Owner

saprykin commented Oct 11, 2023

Or if you use CMake between 3.3+ and 3.12, in this case the fix would be needed.

Okay, I can confirm that with CMake version in the range of 3.3 to 3.12 the warning appears. Will include the fix tomorrow.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@saprykin saprykin merged commit 67947d2 into saprykin:master Oct 12, 2023
3 of 6 checks passed
@etodanik etodanik deleted the patch-1 branch October 12, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants