Skip to content

Fix building on OSX (script, installation) #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CoreFoundation/Base.subproj/CFAvailability.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...)
#endif

#if DEPLOYMENT_RUNTIME_SWIFT
// PortableFoundation is a standalone module and does not depend on system version
#undef CF_AVAILABLE
#undef CF_AVAILABLE_MAC
#undef CF_AVAILABLE_IOS
#undef CF_DEPRECATED
#undef CF_DEPRECATED_MAC
#undef CF_DEPRECATED_IOS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not certain this is the right move here. It has some consequences that might sign us all up for things that would tie our hands for fixing things in the future. It might be a good idea to break this up into more than one pull request so we can consider the full meaning individually

#define CF_AVAILABLE(_mac, _ios)
#define CF_AVAILABLE_MAC(_mac)
#define CF_AVAILABLE_IOS(_ios)

#if __has_attribute(deprecated) // Keep deprecation warnings
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) __attribute__((deprecated(__VA_ARGS__)))
#else
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...)
#endif

#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...) CF_DEPRECATED(_macIntro, _macDep, 0, 0, __VA_ARGS__)
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...) CF_DEPRECATED(0, 0, _iosIntro, _iosDep, __VA_ARGS__)
#endif

// Older versions of these macros; use iOS versions instead
#define CF_AVAILABLE_IPHONE(_ios) CF_AVAILABLE_IOS(_ios)
#define CF_DEPRECATED_IPHONE(_iosIntro, _iosDep) CF_DEPRECATED_IOS(_iosIntro, _iosDep)
Expand Down
4 changes: 2 additions & 2 deletions CoreFoundation/Base.subproj/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ void __CFInitialize(void) {
#if TARGET_OS_LINUX
#define __CFSwiftGetBaseClass _TF10Foundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
#elif TARGET_OS_MAC
#define __CFSwiftGetBaseClass _TF15SwiftFoundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
#define __CFSwiftGetBaseClass _TF18PortableFoundation21__CFSwiftGetBaseClassFT_PMPs9AnyObject_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a change just to change the name right? Again these changes seem to be a fully different set of thoughts here (irregardless of what the name may infer). Personally I think that it would be nice if we could somehow unify both targets to be the same thing: but that comes at some complexity.

Copy link
Contributor Author

@karwa karwa May 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just changed the name. Unifying the names would be great, and if we ship this library with Darwin (as I think we should) it would be essential.

#endif
#endif
extern uintptr_t __CFSwiftGetBaseClass();
Expand Down Expand Up @@ -1164,7 +1164,7 @@ void __CFInitialize(void) {
#if TARGET_OS_LINUX
#define __CFInitializeSwift _TF10Foundation19__CFInitializeSwiftFT_T_
#elif TARGET_OS_MAC
#define __CFInitializeSwift _TF15SwiftFoundation19__CFInitializeSwiftFT_T_
#define __CFInitializeSwift _TF18PortableFoundation19__CFInitializeSwiftFT_T_
#endif
#endif
extern void __CFInitializeSwift();
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Base.subproj/DarwinSymbolAliases
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


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

_kCFCalendarIdentifierBuddhist _kCFBuddhistCalendar
_kCFCalendarIdentifierChinese _kCFChineseCalendar
Expand Down
105 changes: 0 additions & 105 deletions CoreFoundation/Base.subproj/SymbolAliases

This file was deleted.

2 changes: 1 addition & 1 deletion Docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Build and test steps:

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

> 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`.
Expand Down
Loading