[build] Do not override macOS deployment target when macCatalyst is enabled

Cxx.swiftmodule should built with a macOS deployment target set to 10.9, the minimum possible version. Since we enabled macCatalyst for this target, it inadvertently started being built with a deployment target set to 13.0, which is too new and is causing build errors in certain projects.

This change makes sure that for Swift targets within the Swift project that explicitly specify `DEPLOYMENT_VERSION_OSX`, the macCatalyst build logic doesn't silently discard this flag.

rdar://133008827
This commit is contained in:
Egor Zhdan
2024-08-28 15:36:28 +01:00
parent 8879ae5417
commit e1bff808d7
2 changed files with 8 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ function(get_target_triple target_out_var target_variant_out_var sdk arch)
elseif(maccatalyst_build_flavor STREQUAL "macos-like")
# Use the default macOS triple.
elseif(maccatalyst_build_flavor STREQUAL "zippered")
set(target "${arch}-apple-macosx${SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX}")
set(target "${arch}-apple-macosx${deployment_version}")
set(target_variant "${arch}-apple-ios${SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST}-macabi")
elseif(maccatalyst_build_flavor STREQUAL "unzippered-twin")
# Use the default triple for now

View File

@@ -0,0 +1,7 @@
// RUN: %target-build-swift %s -cxx-interoperability-mode=default -target arm64-apple-macos11.0
// REQUIRES: OS=macosx
import Cxx
public func takesCxxType(_ s: some CxxSequence) {}