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"
Regards,
-- 
Fred 


From: Evtim Papushev via swift-users <swift-users@swift.org>
Reply: Evtim Papushev <e.papus...@me.com>
Date: 11 October 2017 at 12:00:24
To: swift-users@swift.org <swift-users@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?

Thanks,
Evtim
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to