From edbbe115a268529e7a9c095c12508d0355567aac Mon Sep 17 00:00:00 2001 From: Noah Thornton Date: Thu, 20 Aug 2026 16:29:10 -0700 Subject: [PATCH] Add a SWIFT_CONFIGURATION_EXTRA hook for extra swift build flags SWIFT_CONFIGURATION is a := assignment carrying -warnings-as-errors and -enable-testing, so a caller wanting to add a flag had to override the whole variable and thereby drop those. Append an overridable SWIFT_CONFIGURATION_EXTRA instead, so extra flags compose with the existing configuration rather than replacing it. Empty by default, so this is a no-op unless set. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8c353c86..70bbbc11e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,10 @@ # Version and build configuration variables BUILD_CONFIGURATION ?= debug WARNINGS_AS_ERRORS ?= true -SWIFT_CONFIGURATION := $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors) -Xswiftc -enable-testing +# Extra swift build flags, appended last so callers can add to (rather than +# replace) the configuration above. +SWIFT_CONFIGURATION_EXTRA ?= +SWIFT_CONFIGURATION := $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors) -Xswiftc -enable-testing $(SWIFT_CONFIGURATION_EXTRA) # Code-coverage instrumentation, layered onto the shared build stages. Empty for # ordinary builds; the coverage-* targets opt in via a target-specific value so # only those goals compile instrumented binaries.