[vcpkg-cmake] Add check for unused cmake variables#18201
[vcpkg-cmake] Add check for unused cmake variables#18201JackBoosY wants to merge 25 commits intomicrosoft:masterfrom
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. |
strega-nil-ms
left a comment
There was a problem hiding this comment.
I'll do these changes; the same changes are also necessary for vcpkg_configure_cmake.
strega-nil-ms
left a comment
There was a problem hiding this comment.
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 <mazzucan@outlook.com> Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com>
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_SKIPto ignore them, and cmake regular expressions are supported:vcpkg_cmake_configure( ... OPTIONS_CHECK_SKIP "WITH_XXX_SUPPORT" )