From 9c08d2251845fd0e607b2c801074ebb419b87eba Mon Sep 17 00:00:00 2001 From: Stuart Montgomery Date: Wed, 16 Apr 2025 20:31:34 -0500 Subject: [PATCH] Ensure the .whenEmbedded() build setting condition evaluates to false when building for non-Embedded without a fallback condition --- Package.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 80e6ce797..2bd95be6a 100644 --- a/Package.swift +++ b/Package.swift @@ -239,8 +239,9 @@ extension BuildSettingCondition { if let nonEmbeddedCondition = nonEmbeddedCondition() { nonEmbeddedCondition } else { - // The caller did not supply a fallback. - .when(platforms: []) + // The caller did not supply a fallback. Specify a non-existent platform + // to ensure this condition never matches. + .when(platforms: [.custom("DoesNotExist")]) } } else { // Enable unconditionally because the target is Embedded Swift.