[swift-users] Package Manager: Link to a static library.

Fred Appelman fred at appelman.net
Wed Oct 11 05:49:54 CDT 2017

If it is just the library that cannot be found you may try to pass the directory where the library can be found to xcode. E.g.:

swift build -Xlinker "-L/usr/local/lib"

From: Evtim Papushev via swift-users <swift-users at swift.org>
Reply: Evtim Papushev <e.papushev at me.com>
Date: 11 October 2017 at 12:00:24
To: swift-users at swift.org <swift-users at swift.org>
Subject:  [swift-users] Package Manager: Link to a static library.  

Hi everyone,

I’m trying to achieve something relatively simple:

I have a C wrapper around C++ code that is built with CMake. So, I have a set of static libraries (.a files) and one header file.

I’m trying to create a Swift Package that contains those files, so I can include them in a project.

I made a module.modulemap:
module FinBar {
    header "fin_bar.h"
    link finbar
    export *

swift build fails as it cannot find the library to link it.

Any suggestions?

swift-users mailing list
swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171011/3a7276e6/attachment.html>

More information about the swift-users mailing list