[CMake] XCode Generation Issue

David Morsberger dave at morsberger.com
Tue Jan 19 21:43:10 EST 2016


Any help would be appreciated. 

In particular I’d like to know how the default compiler arguments are set when ‘cmake -G Xcode’ is executed. The attached file contains the cmake test compile extracted and reformatted from CMakeOutput.log that should have failed. Again, what is setting all the clang compiler options when this is executed?



All help is appreciated

> On Jan 18, 2016, at 2:58 PM, David Morsberger <dave at morsberger.com> wrote:
> 
> I’m having an issue generating and using a XCode project using cmake -G.
> 
> cmake —version
>     cmake version 3.4.1
> 
> Xcode Version 7.2 (7C68)
> 
> Mac OS 10.11.
> 
> 
> My CMakeLists.txt has a clang option that fails during the -G Xcode pass but fails when linking within XCode.
> 
> The compiler / linker option is ‘-Wl,—as-needed’
> 
> 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>’
> 
> 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.
> 
> 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. 
> 
> 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.
> 
> Questions:
>  - Where is the ‘—serialized-diagnostics’ argument coming from when executing ‘cmake -G Xcode’?
> 
>  - What is a .dia file and how do I read it?
> 
>  - 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.
> 
> I can provide more details on request.
> 
> David
> 
> 
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160119/971eb704/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: make_pass.sh.txt
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160119/971eb704/attachment-0001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160119/971eb704/attachment-0003.html>


More information about the CMake mailing list