PackageModel: add struct BuildFlags
, reduce reliance on TSC
#5837
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.
Motivation:
We're relying on
BuildFlags
from TSC for passing flags in some places, but there are also cases where flags are passed as separate properties, such asextraCFlags
,extraCXXFlags
etc.BuildFlags
is quite useful, as it allows grouping of these properties instead of passing them around separately. In most if not all cases they need to be passed all at once anyway. This apparently already let to issues, whereDestination
didn't have its own linker flags property, also see #5793. We also had issues with inconsistent naming of these properties. Unifying everything underBuildFlags
could prevent such issues from happening.Modifications:
Adding
BuildFlags
toPackageModel
, mostly a copy of the declaration in TSC, but with a cleaned up initializer arguments naming. Modified uses of build tools flags to use this new struct instead of passing arounds properties separately.Result:
Reduced reliance on TSC, unified use of
BuildFlags
across the codebase.