Skip to content

Commit 8187cce

Browse files
committed
Build for OSX with build script - create dynamic library
'PortableFoundation' Changed swift build dir environment variable; 'SDKROOT' conflicts with xcrun, is now 'SWIFT_SDKROOT'. Requires updating swift's build script.
1 parent 11184f7 commit 8187cce

File tree

73 files changed

+164
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+164
-235
lines changed

CoreFoundation/Base.subproj/CFAvailability.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,29 @@
8989
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...)
9090
#endif
9191

92+
#if DEPLOYMENT_RUNTIME_SWIFT
93+
// PortableFoundation is a standalone module and does not depend on system version
94+
#undef CF_AVAILABLE
95+
#undef CF_AVAILABLE_MAC
96+
#undef CF_AVAILABLE_IOS
97+
#undef CF_DEPRECATED
98+
#undef CF_DEPRECATED_MAC
99+
#undef CF_DEPRECATED_IOS
100+
101+
#define CF_AVAILABLE(_mac, _ios)
102+
#define CF_AVAILABLE_MAC(_mac)
103+
#define CF_AVAILABLE_IOS(_ios)
104+
105+
#if __has_attribute(deprecated) // Keep deprecation warnings
106+
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) __attribute__((deprecated(__VA_ARGS__)))
107+
#else
108+
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...)
109+
#endif
110+
111+
#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...) CF_DEPRECATED(_macIntro, _macDep, 0, 0, __VA_ARGS__)
112+
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...) CF_DEPRECATED(0, 0, _iosIntro, _iosDep, __VA_ARGS__)
113+
#endif
114+
92115
// Older versions of these macros; use iOS versions instead
93116
#define CF_AVAILABLE_IPHONE(_ios) CF_AVAILABLE_IOS(_ios)
94117
#define CF_DEPRECATED_IPHONE(_iosIntro, _iosDep) CF_DEPRECATED_IOS(_iosIntro, _iosDep)

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ void __CFInitialize(void) {
10511051
#if TARGET_OS_LINUX
10521052
#define __CFSwiftGetBaseClass _TF10Foundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
10531053
#elif TARGET_OS_MAC
1054-
#define __CFSwiftGetBaseClass _TF15SwiftFoundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
1054+
#define __CFSwiftGetBaseClass _TF18PortableFoundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
10551055
#endif
10561056
#endif
10571057
extern uintptr_t __CFSwiftGetBaseClass();
@@ -1164,7 +1164,7 @@ void __CFInitialize(void) {
11641164
#if TARGET_OS_LINUX
11651165
#define __CFInitializeSwift _TF10Foundation19__CFInitializeSwiftFT_T_
11661166
#elif TARGET_OS_MAC
1167-
#define __CFInitializeSwift _TF15SwiftFoundation19__CFInitializeSwiftFT_T_
1167+
#define __CFInitializeSwift _TF18PortableFoundation19__CFInitializeSwiftFT_T_
11681168
#endif
11691169
#endif
11701170
extern void __CFInitializeSwift();

CoreFoundation/Base.subproj/DarwinSymbolAliases

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
# This is specific to Swift open source; Foundation's NSCFConstantString is used as our constant string class reference
4-
__TMC15SwiftFoundation19_NSCFConstantString ___CFConstantStringClassReference
4+
__TMC18PortableFoundation19_NSCFConstantString ___CFConstantStringClassReference
55

66
_kCFCalendarIdentifierBuddhist _kCFBuddhistCalendar
77
_kCFCalendarIdentifierChinese _kCFChineseCalendar

CoreFoundation/Base.subproj/SymbolAliases

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

Docs/GettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Build and test steps:
2525

2626
0. Run Xcode with the latest toolchain. Follow [the instructions here](https://swift.org/download/#apple-platforms) to start Xcode with the correct toolchain.
2727
0. Open `Foundation.xcworkspace`.
28-
0. Build the _SwiftFoundation_ target. This builds CoreFoundation and Foundation.
28+
0. Build the _PortableFoundation_ target. This builds CoreFoundation and Foundation.
2929
0. Run (Cmd-R) the _TestFoundation_ target. This builds CoreFoundation, Foundation, XCTest, and TestFoundation, then runs the tests.
3030

3131
> Note: If you see the name of the XCTest project file in red in the workspace, then Xcode cannot find the cloned XCTest repository. Make sure that it is located next to the `swift-corelibs-foundation` directory and has the name `swift-corelibs-xctest`.

0 commit comments

Comments
 (0)