[swift-users] [swift-build-dev] Importing C system libraries

Joseph Heck heckj at mac.com
Tue Mar 28 14:44:10 CDT 2017


Given the effort behind wrapping all of the functionality in swift package manager into an API (libPackageManager) so that in the future it can be used by IDE style tools, I don't think you need to be seriously concerned. It's convenient for the swift package folks, especially while supporting Linux (which doesn't have the Xcode IDE) to utilize the CLI, and it embeds nicely into Xcode build scripts as an interim step (and there's a long history of that with clang, llbuild, etc).

I wouldn't call libPackageManager a stable API (and I suspect the SwiftPM team wouldn't either), but it's the right structure to support future interactions and IDE support - Xcode or other projects that want to leverage it.

 - joe

> On Mar 27, 2017, at 2:10 PM, Jan Neumüller via swift-build-dev <swift-build-dev at swift.org> wrote:
> 
> Is it just me, or is Swift moving to much in a command line direction since the open sourcing? I feel being left behind as an Xcode user...
> 
> Jan
> 
>> On 27 Mar 2017, at 22:59, Michael Ilseman via swift-users <swift-users at swift.org> wrote:
>> 
>> Sure. At a low level, you can create a module.map file and use -L/-l flags in your invocation of Swift. If you want to do so at a higher level, then perhaps SwiftPM can. CCing swift-build-dev for the SwiftPM part.
>> 
>> 
>>> On Mar 26, 2017, at 3:20 PM, Kelvin Ma via swift-users <swift-users at swift.org> wrote:
>>> 
>>> Idk if this has been asked before, but is there a way to import C libraries into a Swift project without creating a local git repo? Preferably something similar to C where you can just `#include` headers and then specify the link flags (in Package.swift?) 
>>> 
>>> It’s getting very cumbersome to make a bunch of empty git repos just to use libglfw or libcairo.
>>> _______________________________________________
>>> swift-users mailing list
>>> swift-users at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-users
>> 
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev


More information about the swift-users mailing list