Repository navigation
ci: Lint CMake for GCC/Clang -W options that would reach MSVC (#634 item 8) - #719
Merged
Merged
Conversation
zackees
enabled auto-merge
October 14, 2026 09:11
ci/msvc_flags.py parses CMake commands and if() chains and reports a -W option given to target_compile_options, add_compile_options or a COMPILE_OPTIONS property outside a compiler-id generator expression, a branch that excludes MSVC, or a platform-only file. ci/test_msvc_flags.py runs it in ./lint; master has no such option today. Refs #634
zackees
force-pushed
the
ci/634-msvc-flag-lint
branch
from
October 14, 2026 09:12
3729e23 to
35686b7
Compare
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #634 (item 8)
MSVC rejects unknown
-W...options (D8021), and GCC pragmas or flags that slip through fail the Windows build last (#570/#571).ci/msvc_flags.pyparses CMake commands, including multi-lineif/elseifchains. It reports a-Woption given totarget_compile_options,add_compile_optionsor aCOMPILE_OPTIONSproperty unless one of these guards it:$<$<C_COMPILER_ID:GNU,Clang>:-Wno-x>)NOT MSVC, a GNU/Clang compiler id,OS_LINUX/OS_MACOS/APPLE/..., or theelse()of a branch that covers Windows)cmake/{macos,linux}/,os-*.cmake,plugins/{mac,linux}-*,sndio)Options kept in variables are not followed.
ci/test_msvc_flags.pyruns it in./lint(ci/test_*.py).RED → GREEN
COMPILE_OPTIONSproperties, Windows branches andelse()inversion. The repository scan is clean (uv run ci/msvc_flags.pyexits 0), and./lintis ok.