<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 30, 2017, at 4:48 PM, Jimmy Yue via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><span style="font-size:12.8px" class="">Hey Swift Devs,</span><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Does there happen to be an environment variable, similar to 'CC' for C, that I could use to override the path to the Swift compiler? If so, is there also one for ibtool, metal, etc.?</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I want to redirect swift calls to a bash script that does some processing before running the original compile call. Preferably, I would have all the information available to the swift call (input files, output files, etc.), which makes using a build rule a little difficult.</div></div></div></blockquote><br class=""></div><div>You might be able to do this using the "Build Rules" settings in Xcode. (project settings &gt; target settings &gt; Build Rules &gt; click Copy to Target for the file type you are interested in)</div><div><br class=""></div><div>Xcode honors SWIFT_LIBRARY_PATH and SWIFT_EXEC in project settings, but that is designed to substitute the entire Swift toolchain, not just the Swift compiler itself. SWIFT_EXEC might work if your wrapper script lives next to swiftc in the filesystem.</div><div><br class=""></div><div><br class=""></div><div>--&nbsp;</div><div>Greg Parker &nbsp; &nbsp; <a href="mailto:gparker@apple.com" class="">gparker@apple.com</a>&nbsp; &nbsp; &nbsp;Runtime Wrangler</div><div><br class=""></div><div><br class=""></div></body></html>