<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hello again,<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I've been attempting add to the swift-build script so that Foundation can be compiled as a static lib. Simialr to<br><br>> swift/utils/build-script -r --build-swift-static-stdlib --foundation<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I'm not familiar with Cmake, ninja and the way the swift is built but have got the build working. I have a few questions:<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Can a libFoundation.a file be compiled from the .o files that are created while building libFoundation.so?<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Is there a guide or recommended tutorial for Cmake and ninja that might be suitable for a novice, like me?<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Are there any documents that give an overview of how the build fits together and where I should be looking to add functionality? I can't quite work out how the build script transitions to ninja and clang.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Hope that makes some sense?<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Thanks<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Joel<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 September 2016 at 17:13, Joel Hughes <span dir="ltr"><<a href="mailto:rudenoise@gmail.com" target="_blank">rudenoise@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hi,<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I'm attempting to get a statically linked binary and am running into errors.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I'm using Swift 3 Preview 6 on Ubuntu.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Regular _swift build_ and _swift test_ are all running fine.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I can produce a static binary for a simple "hello world" using:<br><br>swift build -c release -Xswiftc -static-stdlib<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">(although I do get error while loading shared libraries: libicui18n.so.55 when running in a basic vm).<br></div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">However I can't compile a more complicated project. It's only dependency is Foundation (it uses NSUUID, and JSON) and can't seem to find them.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">I get a stream of errors, examples:<br><br>Linking ./.build/release/joke<br>/usr/bin/ld.gold: error: cannot find -lFoundation<br>...<br>error: undefined reference to '_TMaC10Foundation6NSUUID'<br>...<br>error: undefined reference to '_<wbr>TFC10Foundation6NSUUIDCfT10uui<wbr>dStringSS_GSqS0__'<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Any pointers or advice much appreciated.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Thanks<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="font-family:courier new,monospace">Joel<br></div></font></span></div>
</blockquote></div><br></div>