Can't find CoreFoundation


(Eben Up) #1

Hi all,
Before jumping over to try using Swift on Linux, I've compiled Swift on MacOS and I can see that CoreFoundation is located in ./swift/stdlib/public/Darwin/, however how can I tell swiftc where to find it?

These are throwing errors:

$ ./build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swiftc  -sdk ./swift/stdlib/  ~/Desktop/main.swift
<unknown>:0: error: cannot load underlying module for 'CoreFoundation'

$ ./build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swiftc  -sdk ./swift/stdlib/public/  ~/Desktop/main.swift
<unknown>:0: error: cannot load underlying module for 'CoreFoundation'

$ ./build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swiftc  -sdk ./swift/stdlib/public/Darwin/  ~/Desktop/main.swift
<unknown>:0: error: cannot load underlying module for 'CoreFoundation'

Thanks.


(Max Moiseev) #2

"stdlib/public/Darwin" contains CoreFoundation overlay. The Framework itself is where it's always been, along with the other SDKs inside "Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs".


(Eben Up) #3

Where would Foundation ultimately get installed on a non-MacOS system like GNU/Linux?


(Max Moiseev) #4

Will the following lines from the corelibs-foundation build script help? https://github.com/apple/swift-corelibs-foundation/blob/master/build.py#L571-L580


(Saleem Abdulrasool) #5

Note that non-Darwin targets now build using CMake. The install rules for Foundation are here.


(Lily Vulcano) #6

Note also that Core Foundation code in non-Darwin OSes is in libFoundation.so (soon libFoundationBase.so).

Core Foundation support outside of Darwin is limited, and not all code that uses CF may compile. (If the code compiles, it is intended to work correctly, though.)


Undeclared type 'CFMutableBitVector