Handle externalwarnings in the clang toolset - #2803
Merged
Merged
Conversation
samsinsane
approved these changes
Sep 13, 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.
What does this PR do?
clang.sharedfollowsgcc.sharedentry by entry, either delegating to it or overriding it with something clang specific.externalwarningsis the one exception: gcc has the mapping, clang has neither.So
externalwarnings "High"is silently ignored undertoolset "clang".externalincludedirsstill emits-isystem<dir>, so warnings from vendored headers are supressed, and the option ment to turn them back on emits nothing at all. Nothing tells you the setting was dropped.How does this PR change Premake's behavior?
Clang now uses gcc's
externalwarningsmapping. Clang accepts-Wsystem-headers, so the option can do what it says.With
externalincludedirsandexternalwarnings "High"set on a gmake project, here is the line each toolset generated:After the change clang gets
-Wsystem-headerstoo. Existing behaviour only moves whenexternalwarningsis actualy set for clang or emcc.Anything else we should know?
premake5 testpasses all 2903 tests from 232 suites. Before the fixcflags_onHighExternalWarningsfails and nothing else does.Two things I havent checked: the right replacement for the Availability line in
website/docs/externalwarnings.md, which already says "Premake 5.0.0-alpha1 or later for Visual Studio 2019+" despite gcc support, and whether clang should emit an explicit-Wno-system-headersforexternalwarnings "Off". gcc doesn't, so I've left it alone.This slipped in when
externalwarningswas added to gcc in #1754 (065b3acb, merged 2022-01-04). That PR did touchsrc/tools/clang.lua, but only to renamesysdirstoextdirs. The mapping lives in three places rather than one: gcc declares it, clang keeps a hand-written copy of gcc's table rather than merging into it, and emcc deep-copies clang. A new key in gcc reaches none of them by itself, and an unmapped option just becomes a no-op, so nothing goes red.Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged) - none that I could find