Skip to content

Commit 3328592

Browse files
authored
Merge pull request swiftlang#5942 from compnerd/windows-target-sdks
build: remove `TARGET_SDKS` from the runtime
2 parents 7907962 + c67a33f commit 3328592

13 files changed

+37
-63
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ set(swift_runtime_sources
5151
Once.cpp
5252
Portability.cpp
5353
ProtocolConformance.cpp
54-
ReflectionNative.cpp
55-
RuntimeEntrySymbols.cpp
56-
SwiftObjectNative.cpp)
54+
RuntimeEntrySymbols.cpp)
5755

5856
# Acknowledge that the following sources are known.
5957
set(LLVM_OPTIONAL_SOURCES
@@ -119,16 +117,7 @@ add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
119117
${swift_runtime_leaks_sources}
120118
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
121119
LINK_FLAGS ${swift_runtime_linker_flags}
122-
INSTALL_IN_COMPONENT never_install
123-
TARGET_SDKS ALL_APPLE_PLATFORMS)
124-
125-
add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
126-
${swift_runtime_sources}
127-
${swift_runtime_leaks_sources}
128-
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
129-
LINK_FLAGS ${swift_runtime_linker_flags}
130-
INSTALL_IN_COMPONENT never_install
131-
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX)
120+
INSTALL_IN_COMPONENT never_install)
132121

133122
set(ELFISH_SDKS)
134123
foreach(sdk ${SWIFT_CONFIGURED_SDKS})

stdlib/public/runtime/ErrorObject.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
//
2222
//===----------------------------------------------------------------------===//
2323

24+
#include "swift/Runtime/Config.h"
25+
26+
#if SWIFT_OBJC_INTEROP
2427
#include "swift/Runtime/Debug.h"
2528
#include "swift/Runtime/ObjCBridge.h"
2629
#include "swift/Basic/Lazy.h"
@@ -592,3 +595,5 @@ static void _swift_willThrow_(SwiftError *error) { }
592595
void swift::swift_willThrow(SwiftError *error) {
593596
return _swift_willThrow(error);
594597
}
598+
#endif
599+

stdlib/public/runtime/ReflectionNative.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

stdlib/public/runtime/SwiftObject.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
//===----------------------------------------------------------------------===//
1717

1818
#include "swift/Runtime/Config.h"
19+
1920
#if SWIFT_OBJC_INTEROP
2021
#include <objc/NSObject.h>
2122
#include <objc/runtime.h>

stdlib/public/runtime/SwiftObjectNative.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

stdlib/public/runtime/SwiftValue.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
//
1919
//===----------------------------------------------------------------------===//
2020

21+
#include "swift/Runtime/Config.h"
22+
23+
#if SWIFT_OBJC_INTEROP
2124
#include "SwiftObject.h"
2225
#include "SwiftValue.h"
2326
#include "swift/Basic/Lazy.h"
@@ -30,10 +33,6 @@
3033
#include <objc/runtime.h>
3134
#include <Foundation/Foundation.h>
3235

33-
#if !SWIFT_OBJC_INTEROP
34-
#error "This file should only be compiled when ObjC interop is enabled."
35-
#endif
36-
3736
using namespace swift;
3837
using namespace swift::hashable_support;
3938

@@ -380,6 +379,7 @@ - (const OpaqueValue *)_swiftValue {
380379
}
381380

382381
@end
382+
#endif
383383

384384
// TODO: We could pick specialized _SwiftValue subclasses for trivial types
385385
// or for types with known size and alignment characteristics. Probably

stdlib/public/stubs/Availability.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#include "swift/Runtime/Config.h"
18+
19+
#if SWIFT_OBJC_INTEROP
1720
#include "swift/Basic/Lazy.h"
1821
#include "swift/Runtime/Debug.h"
1922
#import <Foundation/Foundation.h>
@@ -93,3 +96,5 @@ static NSOperatingSystemVersion getOSVersion() {
9396

9497
return { version.majorVersion, version.minorVersion, version.patchVersion };
9598
}
99+
#endif
100+

stdlib/public/stubs/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,8 @@ list(APPEND swift_stubs_c_compile_flags -DswiftCore_EXPORTS)
2323
add_swift_library(swiftStdlibStubs OBJECT_LIBRARY TARGET_LIBRARY
2424
${swift_stubs_sources}
2525
${swift_stubs_objc_sources}
26-
C_COMPILE_FLAGS ${swift_stubs_c_compile_flags}
27-
LINK_FLAGS ${SWIFT_RUNTIME_CORE_LINK_FLAGS}
28-
TARGET_SDKS ALL_APPLE_PLATFORMS
29-
INSTALL_IN_COMPONENT stdlib)
30-
31-
add_swift_library(swiftStdlibStubs OBJECT_LIBRARY TARGET_LIBRARY
32-
${swift_stubs_sources}
3326
${swift_stubs_unicode_normalization_sources}
3427
C_COMPILE_FLAGS ${swift_stubs_c_compile_flags}
3528
LINK_FLAGS ${SWIFT_RUNTIME_CORE_LINK_FLAGS}
36-
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX
3729
INSTALL_IN_COMPONENT stdlib)
3830

stdlib/public/stubs/FoundationHelpers.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
//
1717
//===----------------------------------------------------------------------===//
1818

19+
#include "swift/Runtime/Config.h"
20+
21+
#if SWIFT_OBJC_INTEROP
1922
#import <CoreFoundation/CoreFoundation.h>
2023
#include "../SwiftShims/CoreFoundationShims.h"
2124

@@ -112,3 +115,5 @@ static CFRange cast(_swift_shims_CFRange value) {
112115
swift::_swift_stdlib_objcDebugDescription(id _Nonnull nsObject) {
113116
return [nsObject debugDescription];
114117
}
118+
#endif
119+

stdlib/public/stubs/OptionalBridgingHelper.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "swift/Runtime/Config.h"
14+
15+
#if SWIFT_OBJC_INTEROP
1316
#include "swift/Basic/Lazy.h"
1417
#include "swift/Basic/LLVM.h"
1518
#include "swift/Runtime/Metadata.h"
@@ -97,3 +100,5 @@ id _swift_Foundation_getOptionalNilSentinelObject(const Metadata *Wrapped) {
97100

98101
return objc_retain(getSentinelForDepth(depth));
99102
}
103+
#endif
104+

stdlib/public/stubs/Reflection.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "swift/Runtime/Config.h"
14+
15+
#if SWIFT_OBJC_INTEROP
1416
#import <Foundation/Foundation.h>
1517

1618
SWIFT_CC(swift)
@@ -24,4 +26,5 @@
2426

2527
return result;
2628
}
29+
#endif
2730

stdlib/public/stubs/SwiftNativeNSXXXBase.mm.gyb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
//
3131
//===----------------------------------------------------------------------===//
3232

33+
#include "swift/Runtime/Config.h"
34+
35+
#if SWIFT_OBJC_INTEROP
3336
#import <Foundation/Foundation.h>
3437
#import <CoreFoundation/CoreFoundation.h>
3538
#include <objc/NSObject.h>
@@ -216,6 +219,7 @@ extern "C" void swift_stdlib_CFSetGetValues(NSSet *NS_RELEASES_ARGUMENT set,
216219
CFSetGetValues((__bridge CFSetRef)set, values);
217220
swift_unknownRelease(set);
218221
}
222+
#endif
219223

220224
// ${'Local Variables'}:
221225
// eval: (read-only-mode 1)

stdlib/public/stubs/UnicodeNormalization.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#if !defined(__APPLE__)
1718
#include "swift/Basic/Lazy.h"
1819
#include "swift/Runtime/Config.h"
1920
#include "swift/Runtime/Debug.h"
@@ -283,3 +284,5 @@ swift::_swift_stdlib_unicode_strToLower(uint16_t *Destination,
283284
}
284285

285286
swift::Lazy<ASCIICollation> ASCIICollation::theTable;
287+
#endif
288+

0 commit comments

Comments
 (0)