Closed swift-ci closed 8 years ago
Comment by yuuji (JIRA)
In my other project, I write the modulemap like below and it solves the problem.
module CFoo {
header "CFoo.h"
export *
}
I guess it's because Xcode is trying to find and link the shared library (form the line `link "CLibreSSL"`), which it either never exist nor Xcode has not hint how to find it.
In Swift PM the package manager will automatically generate a libCFoo.dylib under .build/debug after building the library that other dependencies can link with. But in Xcode it's not the case: It will only follow project configuration.
You can add "-L/path/to/your/project/.build/debug/" to "Other Linker Flags" under [Build Setting/Linking] in Xcode. (require you build the C library using the cmd at least once") or simply rewrite the modulemap not to link to "CLibreSSL".
Dup
Comment by tanner0101 (JIRA)
Please link the dup issue
I thought I had, I guess it got lost somehow sorry about that.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | tannernelson (JIRA) | |Priority | Medium | md5: 72c455b3ab9efdb0ec7b1e60a5e92a0cduplicates:
Issue Description:
The lack of a modulemap for the C module https://github.com/vapor/clibressl appears to be causing the package manager to rebuild unchanged modules. Each rebuild takes \~1 minute making development in Xcode the only realistic option.
Adding the following module map fixes the command line, but causes Xcode to fail with a `cannot find lib clibressl`. Therefore we have to rely on the automatically generated modulemap which might be the culprit behind this issue.
Here's the module map that fixes the CLI but breaks Xcode:
`Packages/CLibreSSL-xxx/Sources/CLibreSSL/include/module.modulemap`
Here is the output of two `swift build` calls in a row, without any modification to the source code between calls (and without a modulemap).