<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><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="">I’m having an issue generating and using a XCode project using cmake -G.<div class=""><br class=""></div><div class="">cmake —version</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">    cmake version 3.4.1</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class="">Xcode Version 7.2 (7C68)</span></font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class="">Mac OS 10.11.</span></font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div class=""><br class=""></div><div class="">My CMakeLists.txt has a clang option that fails during the -G Xcode pass but fails when linking within XCode.</div><div class=""><br class=""></div><div class="">The compiler / linker option is ‘-Wl,—as-needed’</div><div class=""><br class=""></div><div class="">The test compile/link step in ‘cmake -G Xcode' creates a long clang command with arguments ‘-Wl,—as-needed’ plus ‘—serialize-diagnostics <path to .dia file>’</div><div class=""><br class=""></div><div class="">The link step within Xcode after the project created has the ‘-Wl,—as-needed’ argument and does not have the ‘—serialize-diagnostics <path to .dia file>’ argument. The link fails because ‘-Wl,—as-needed’ isn’t supported.</div><div class=""><br class=""></div><div class="">If copy and execute the long clang command from the ‘cmake -G Xcode’ command and remove the ‘—serialize-diagnostics <path to .dia file>’ then it successfully fails with ‘-Wl, —as-needed’ isn’t supported. </div><div class=""><br class=""></div><div class="">Finally, when I use cmake to generate unix makefiles it works meaning cmake determines ‘-Wl—as-needed’ isn’t supported and doesn’t add it to the argument list.</div><div class=""><br class=""></div><div class="">Questions:</div><div class=""> - Where is the ‘—serialized-diagnostics’ argument coming from when executing ‘cmake -G Xcode’?</div><div class=""><br class=""></div><div class=""> - What is a .dia file and how do I read it?</div><div class=""><br class=""></div><div class=""> - What’s the preferred / recommended way of detecting the non-supported ‘-Wl,—as-needed’ argument during the ‘cmake -G Xcode’ phase? One option might to be to remove the ‘—serialize-diagnostics’ argument during the generation phase.</div><div class=""><br class=""></div><div class="">I can provide more details on request.</div><div class=""><br class=""></div><div class="">David</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></body></html>