[swift-users] How do I use Xcode for a C library wrapped in Swift

Ankit Agarwal ankit at ankit.im
Fri Dec 23 00:06:53 CST 2016


This setup should do what you described:

[image: Inline image 1]

On Fri, Dec 23, 2016 at 2:13 AM, Dave Yost via swift-users <
swift-users at swift.org> wrote:

> I just posted this on StackOverflow
> <http://stackoverflow.com/questions/41290913/how-do-i-use-xcode-for-a-c-library-wrapped-in-swift>.
> Insights most welcome.
>
> I'm trying to create an Xcode workspace that contains projects that make:
>
>
>    - A bird dynamic library built from C source
>       - A Cbird Swift module that wraps bird in raw Swift
>       - A Bird Swift module that imports Cbird and wraps it in swifty
>       Swift
>       - A birdchirp Swift Command Line Tool that imports Bird
>
> All of these must have an OS X Unit Testing Bundle.
>
> I've tried various ways with various versions of Swift 3.x and snapshots
> to do this starting from Project.swift files and using swift package
> generate-xcodeproj. All of these attempts have resulted in Xcode setups
> that have various problems:
>
>
>    - having to do a swift build first and then rooting an Xcode project
>       in a directory deep within the .build directory (created by swift
>       build) or within the (apparently now defunct) Packages directory
>       - having to refer to other projects via github addresses
>       - trouble with unit test bundles not finding Cbird
>       - Selecting Cbird in an import Cbird source line and doing Jump to
>       Definition fails to show the Swift source for Cbird.
>       - The birdchirp project cheats and refers to Bird source files
>       directly instead of depending on the Bird framework.
>
> Extra credit:
>
>
>    - Package.swift files that work with relative references to the other
>       projects, while still allowing the projects to be mirrors of GitHub projects
>
>
>
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
>


-- 
Ankit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161223/56d5c76b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-12-23 at 11.35.17 AM.png
Type: image/png
Size: 172583 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161223/56d5c76b/attachment.png>


More information about the swift-users mailing list