<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 20, 2016, at 7:25 AM, Martin Man via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi guys,<div class=""><br class=""></div><div class="">I’m wrapping three little native C libraries using SPM to a nice swifty modules. Say cmod1, cmod2, and cmod3. They all in the and are dependencies of a bigger project.</div><div class=""><br class=""></div><div class="">Since these legacy C libraries have headers in various ways incompatible with SPM I’m also providing my own custom module.modulemap inside of Sources/cmod1/include folder which exports only certain headers.</div><div class=""><br class=""></div><div class="">The module.modulemap is in pretty standard form with relative path to the header</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">module cmod1 {</font></div><div class=""><font face="Menlo" class="">header “cmod1/header1.h”</font></div><div class=""><font face="Menlo" class="">export “*”</font></div><div class=""><font face="Menlo" class="">link “cmod1"</font></div><div class=""><font face="Menlo" class="">} </font></div><div class=""><br class=""></div><div class="">When using ``swift build`` to build the module, C sources compile fine but switc bails out when parsing modulemap because it can not find headers referenced from header1.h with an error message like this</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><module-includes>:1:10: note: in file included from <module-includes>:1:</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#include “/projects/something/Sources/cmod1/include/cmod/header1.h"</span></div></div></div></div></blockquote><div><br class=""></div>Is this misspelled? cmod/header1.h vs cmod1/header1.h?</div><div><br class=""></div><div>Can you show the exact include style used in the module.modulemap and in the project?</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ^</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/projects/something/Sources/cmod1/include/cmod1/header1.h:18:10: error: ‘cmod1/header2.h' file not found</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="font-family: Helvetica; font-size: 12px;" class="">Now I know that I can give swiftc correct -Xswiftc -Ipath switch and then it builds cleanly, but this means that plain ``swift build`` never succeeds…</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">Q1: Is my assumption correct that the ultimate goal of mine is to make the swift package build cleanly using just ``swift build`` without providing any commandline flags?</div></div></div></div></blockquote><div><br class=""></div>Yes.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="font-family: Helvetica; font-size: 12px;" class="">Q2: When build of a certain package cmod1 requires command line flags -Xcc -Xlinker and -Xswiftc, what’s the correct way to pass them in when such package is a dependency of bigger project and which gets git pulled and compiled as part of outer package build?</div></div></div></div></blockquote><div><br class=""></div>We don't have a solution for this yet, eventually we want to find a way that all that data has a proper home in the manifest.</div><div><br class=""></div><div> - Daniel</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">thanks for your time, unfortunately the sources of these packages can not be made public yet but I think I can generate a simple broken project on github if anyone wants to take a look...</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">thanks,</div><div style="font-family: Helvetica; font-size: 12px;" class="">Martin</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div class=""><br class=""></div></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>