From d2cc4d7f94bbc705c6a4a6fbb37ad56caa814b2c Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 26 Nov 2024 15:42:10 +0000 Subject: [PATCH] Cxx interop CI appends swiftSettings (#3002) Cxx interop CI appends `swiftSettings` to any existing settings rather than overriding them. ### Motivation: This better accommodates workflows for example which use Swift 5 language mode on a per-target basis. ### Modifications: Cxx interop CI appends `swiftSettings` to any existing settings rather than overriding them. ### Result: Cxx interop CI jobs don't cause unexpected build configurations. --- scripts/check-cxx-interop-compatibility.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-cxx-interop-compatibility.sh b/scripts/check-cxx-interop-compatibility.sh index 5ad33a609c..9e868e94b5 100755 --- a/scripts/check-cxx-interop-compatibility.sh +++ b/scripts/check-cxx-interop-compatibility.sh @@ -33,7 +33,7 @@ swift package init { echo "let swiftSettings: [SwiftSetting] = [.interoperabilityMode(.Cxx)]" - echo "for target in package.targets { target.swiftSettings = swiftSettings }" + echo "for target in package.targets { target.swiftSettings = (target.swiftSettings ?? []) + swiftSettings }" } >> Package.swift echo "package.dependencies.append(.package(path: \"$source_dir\"))" >> Package.swift