diff --git a/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift b/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift index f19b344f..5fa6022e 100644 --- a/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift +++ b/Sources/XCTest/Public/Asynchronous/XCTWaiter.swift @@ -10,7 +10,7 @@ // XCTWaiter.swift // -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +#if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && USE_FOUNDATION_FRAMEWORK import CoreFoundation #endif @@ -429,7 +429,7 @@ private extension XCTWaiter { func cancelPrimitiveWait() { guard let runLoop = runLoop else { return } -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +#if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && USE_FOUNDATION_FRAMEWORK CFRunLoopStop(runLoop.getCFRunLoop()) #else runLoop._stop() diff --git a/Tests/Functional/lit.cfg b/Tests/Functional/lit.cfg index 78d6e1d9..9f384a98 100644 --- a/Tests/Functional/lit.cfg +++ b/Tests/Functional/lit.cfg @@ -72,6 +72,8 @@ if platform.system() == 'Darwin': # to use, due to a limitation in the Swift compiler. See SR-655 # for details. Here, we include the headers from CoreFoundation. '-I', os.path.join(built_products_dir, 'usr', 'local', 'include'), + '-Xclang-linker', '-nodefaultlibs', '-lpthread', + '-Xfrontend', '-disable-autolink-library', '-Xfrontend', 'swiftCoreFoundation' ]) else: # We need to jump through extra hoops to link swift-corelibs-foundation. diff --git a/XCTest.xcodeproj/project.pbxproj b/XCTest.xcodeproj/project.pbxproj index 27a6a5f2..feb8654a 100644 --- a/XCTest.xcodeproj/project.pbxproj +++ b/XCTest.xcodeproj/project.pbxproj @@ -518,7 +518,10 @@ "-framework", SwiftFoundation, "-weak-lswift_Concurrency", + "-nodefaultlibs", + "-lpthread", ); + OTHER_SWIFT_FLAGS = "-Xfrontend -disable-autolink-library -Xfrontend swiftCoreFoundation"; PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator"; @@ -543,7 +546,10 @@ "-framework", SwiftFoundation, "-weak-lswift_Concurrency", + "-nodefaultlibs", + "-lpthread", ); + OTHER_SWIFT_FLAGS = "-Xfrontend -disable-autolink-library -Xfrontend swiftCoreFoundation"; PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator"; @@ -561,6 +567,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; + MACOSX_DEPLOYMENT_TARGET = 10.13; OTHER_CFLAGS = ""; "OTHER_LDFLAGS[sdk=macosx*]" = ( "-framework", @@ -575,6 +582,7 @@ isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + MACOSX_DEPLOYMENT_TARGET = 10.13; OTHER_CFLAGS = ""; "OTHER_LDFLAGS[sdk=macosx*]" = ( "-framework",