[CMake] XCode Generation Issue

David Morsberger dave at morsberger.com
Mon Jan 18 14:58:58 EST 2016


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/20160118/b7bf94f3/attachment.html>


More information about the CMake mailing list