<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New"}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.HTMLPreformattedChar
        {font-family:"Courier New"}
.MsoChpDefault
        {}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I recently upgraded to Xcode v5 on Mac OSX and started getting build failures. Below is a simplified project that produces the same problem, followed by the error message generated by Xcode. The problem occurs with version v5 but not
v4.6.x of Xcode. I’m running CMake 2.8.10.2.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::::</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">CMakeLists.txt</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::::</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">cmake_minimum_required ( VERSION 2.8.8 )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">project( test )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">add_library( a_obj OBJECT t1.c t2.c )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">add_library( b_obj OBJECT t3.c t4.c )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">add_library( a dummy.c $<TARGET_OBJECTS:a_obj> )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">add_library( b dummy.c $<TARGET_OBJECTS:b_obj> )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">add_executable( t t.c )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">target_link_libraries( t a b )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">t.c</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">#include <stdio.h></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func1( int a );</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func2( int a );</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func3( int a );</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func4( int a );</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int main()</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">{</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> int a = 100;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> printf( "%d %d %d %d %d\n", a, func1(a), func2(a), func3(a), func4(a) );</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> return 0;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">}</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">t1.c</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func1( int a )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">{</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> return a*1;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">}</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">t2.c</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func2( int a )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">{</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> return a*2;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">}</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">t3.c</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func3( int a )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">{</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> return a*3;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">}</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">t4.c</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">::::::::::::::<i></i></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">int func4( int a )</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">{</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> return a*4;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">}</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">dummy.c is empty</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">When I run CMake, no errors; running xcodebuild gives:</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/jschenck/TestBuild/test.build/Release/a_obj.build/Objects-normal/undefined_arch/t1.o
(No such file or directory)</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Users/jschenck/TestBuild/test.build/Release/a_obj.build/Objects-normal/undefined_arch/t2.o
(No such file or directory)</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">The .o files can instead be found here:</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">$ find . -name t1.o</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Courier New"">./test.build/Release/a_obj.build/Objects-normal/x86_64/t1.o</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks for your help. (Sorry for not running this on the latest version of CMake, but I rolled back Xcode to an earlier version and now will have a hard time reproducing it. If necessary, I can “upgrade” again.)</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Regards,</p>
<p class="MsoNormal">Jeff Schenck</p>
<p class="MsoNormal"> </p>
</div>
<br>
<hr>
<font face="Courier New" color="Black" size="3"><br>
Notice:<br>
This message and any included attachments are intended only for the use of the addressee, and may contain information that is privileged or confidential. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have received this communication in error, please destroy the original message and any copies or printouts hereof.<br>
</font>
<br clear=all>
</body>
</html>