-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[vcpkg-cmake] Add check for unused cmake variables #18201
[vcpkg-cmake] Add check for unused cmake variables #18201
Conversation
Set |
Please exclude |
Also this doesn't work if a variable is guarded by an if statement and a vcpkg feature. |
This function is only for the internal options in the source. |
I've checked the pipeline log, and most of the variables in the warnings are indeed out of date. |
Parts of the reported info:
|
Depends on #18202. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do these changes; the same changes are also necessary for vcpkg_configure_cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes requested.
Ping for review again and merge this PR. |
I'll pull this into the next rollup |
Dropping 'reviewed' since it's marked 'next rollup' |
[vcpkg-cmake] Add check for unused cmake variables
Closed as part of rollup PR #19001 |
* [rollup:2021-07-16 1/7] PR #18201 (@JackBoosY) [vcpkg-cmake] Add check for unused cmake variables * [rollup:2021-07-16 2/7] PR #18397 (@strega-nil) [vcpkg_list] add new function * [rollup:2021-07-16 3/7] PR #18782 (@strega-nil) [scripts-audit] vcpkg_build_ninja * [rollup:2021-07-16 4/7] PR #18784 (@strega-nil) [scripts-audit] vcpkg_minimum_required * [rollup:2021-07-16 5/7] PR #18785 (@strega-nil) [scripts-audit] vcpkg_replace_string * [rollup:2021-07-16 6/7] PR #18786 (@strega-nil) [scripts-audit] windows scripts * [rollup:2021-07-16 7/7] PR #18945 (@strega-nil) [many ports] remove deprecated vcpkg_check_features call [1/5] Co-authored-by: nicole mazzuca <[email protected]> Co-authored-by: PhoebeHui <[email protected]>
In cmake, unused variables are reported as warnings, but in vcpkg, this most likely means that the option names were not updated after the port update.
So I check them and report them here.
If some options only take effect on a specific platform, such as:
Use
OPTIONS_CHECK_SKIP
to ignore them, and cmake regular expressions are supported:vcpkg_cmake_configure( ... OPTIONS_CHECK_SKIP "WITH_XXX_SUPPORT" )