<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="">Hi Dan,<div class=""><br class=""></div><div class="">thanks for your comments… I have prepared a simple module here:&nbsp;<a href="https://github.com/mman/cmod1" class="">https://github.com/mman/cmod1</a>.</div><div class=""><br class=""></div><div class="">``git clone`` and ``swift build`` it and you will see the problem I’m talking about…&nbsp;</div><div class=""><br class=""></div><div class="">please let me know if you need any help, I’ll prepare a more complex project showing the problem with this module being used as a dependency of another more complex module soon…</div><div class=""><br class=""></div><div class="">thanks,</div><div class="">Martin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Oct 2016, at 17:34, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Oct 20, 2016, at 7:25 AM, Martin Man via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">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="">}&nbsp;</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 class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span class="" style="font-variant-ligatures: no-common-ligatures;">&lt;module-includes&gt;:1:10: note: in file included from &lt;module-includes&gt;:1:</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span class="" style="font-variant-ligatures: no-common-ligatures;">#include “/projects/something/Sources/cmod1/include/cmod/header1.h"</span></div></div></div></div></blockquote><div class=""><br class=""></div>Is this misspelled? cmod/header1.h vs cmod1/header1.h?</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Can you show the exact include style used in the module.modulemap and in the project?</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span class="" style="font-variant-ligatures: no-common-ligatures;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ^</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/projects/something/Sources/cmod1/include/cmod1/header1.h:18:10: error: ‘cmod1/header2.h' file not found</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><br class=""></div></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><div class="" style="font-family: Helvetica; font-size: 12px;">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 class="" style="font-family: Helvetica; font-size: 12px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px;">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 class=""><br class=""></div>Yes.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><div class="" style="font-family: Helvetica; font-size: 12px;">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 class=""><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 style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&nbsp;- Daniel</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><div class="" style="font-family: Helvetica; font-size: 12px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px;">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 class="" style="font-family: Helvetica; font-size: 12px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px;">thanks,</div><div class="" style="font-family: Helvetica; font-size: 12px;">Martin</div><div class="" style="font-family: Helvetica; font-size: 12px;"><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a></div></blockquote></div></div></blockquote></div><br class=""></div></body></html>