<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pivotal Labs &#187; xcode4</title>
	<atom:link href="http://pivotallabs.com/tag/xcode4/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Wed, 22 May 2013 17:14:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Cedar vs. Xcode 4 (round one: the command line)</title>
		<link>http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/</link>
		<comments>http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 17:41:00 +0000</pubDate>
		<dc:creator>Adam Milligan</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[cedar]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[xcode4]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/</guid>
		<description><![CDATA[<p><p>I've finally found a bit of time to update Cedar to work with Xcode 4, and I hope to have it working smoothly some time in the next few days.  However, I've already come across my first significant issue with the Xcode 4 changes: the location of build products.</p>

<p>Not unexpectedly, the problem has to do with command line builds using <code>xcodebuild</code>.  By default, Xcode 4 now puts build products into a project-specific directory in the "Derived Data" folder; this looks something like <code>/Users/pivotal/Library/Developer/Xcode/DerivedData/Cedar-somegianthashstring/Build/Products/Debug-iphonesimulator/libCedar-StaticLib.a</code>.  This isn't a problem, generally, because the <code>BUILD_DIR</code> compiler variable contains the build directory, should you need to find this location during the build process.</p>

<p>Sadly, when you build from the command line, using the <code>xcodebuild</code> command, the build products still go into the old Xcode 3 build location, but the <code>BUILD_DIR</code> compiler variable contains the new Xcode 4 build directory.  This means any script that looks for the build results in the directory specified by <code>BUILD_DIR</code> won't find anything.</p>

<p>The build target for Cedar's static framework is simply a script that uses <code>xcodebuild</code> to build the static library for both the simulator and the device, and then uses <code>lipo</code> to make a fat binary from the results.  Because it can't find the build results at the location specified by <code>BUILD_DIR</code> it now fails messily.</p>

<p>The easiest workaround I've found is to change where build products go using the Locations setting in the Xcode 4 preferences &#40;details below&#41;.  Unfortunately, this isn't a project-specific setting, so you'll have to change your preferences similarly to make it work.  I haven't found any problems with changing the location of the build products, but this does mean the Cedar static framework &#40;as well as the related static frameworks for OCHamcrest and OCMock&#41; won't build with the default settings.  Unsatisfying.</p>

<p>The longer term solution is for Apple to act on the bug I filed.  We'll see how that goes.</p>

<p><strong>UPDATE: Thanks to <a href="http://github.com/nerdyc">Christian Niles</a> for pointing out the SYMROOT environment variable in a pull request.  Setting this for command line builds forces Xcode to use the specified location for all build products, and updates the BUILD_DIR compiler variable.</strong></p>

<p>Steps for changing the build location in Xcode 4:</p>

<ul>
<li>Open Xcode preferences &#40;Command-,&#41;</li>
<li>Select the "Locations" tab</li>
<li>Change the "Build Location" drop down from "Place build products in derived data location" to "Place build products in locations specified by targets."</li>
</ul> <a href="http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/">Cedar vs. Xcode 4 (round one: the command line)</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve finally found a bit of time to update Cedar to work with Xcode 4, and I hope to have it working smoothly some time in the next few days.  However, I&#8217;ve already come across my first significant issue with the Xcode 4 changes: the location of build products.</p>
<p>Not unexpectedly, the problem has to do with command line builds using <code>xcodebuild</code>.  By default, Xcode 4 now puts build products into a project-specific directory in the &#8220;Derived Data&#8221; folder; this looks something like <code>/Users/pivotal/Library/Developer/Xcode/DerivedData/Cedar-somegianthashstring/Build/Products/Debug-iphonesimulator/libCedar-StaticLib.a</code>.  This isn&#8217;t a problem, generally, because the <code>BUILD_DIR</code> compiler variable contains the build directory, should you need to find this location during the build process.</p>
<p>Sadly, when you build from the command line, using the <code>xcodebuild</code> command, the build products still go into the old Xcode 3 build location, but the <code>BUILD_DIR</code> compiler variable contains the new Xcode 4 build directory.  This means any script that looks for the build results in the directory specified by <code>BUILD_DIR</code> won&#8217;t find anything.</p>
<p>The build target for Cedar&#8217;s static framework is simply a script that uses <code>xcodebuild</code> to build the static library for both the simulator and the device, and then uses <code>lipo</code> to make a fat binary from the results.  Because it can&#8217;t find the build results at the location specified by <code>BUILD_DIR</code> it now fails messily.</p>
<p>The easiest workaround I&#8217;ve found is to change where build products go using the Locations setting in the Xcode 4 preferences &#40;details below&#41;.  Unfortunately, this isn&#8217;t a project-specific setting, so you&#8217;ll have to change your preferences similarly to make it work.  I haven&#8217;t found any problems with changing the location of the build products, but this does mean the Cedar static framework &#40;as well as the related static frameworks for OCHamcrest and OCMock&#41; won&#8217;t build with the default settings.  Unsatisfying.</p>
<p>The longer term solution is for Apple to act on the bug I filed.  We&#8217;ll see how that goes.</p>
<p><strong>UPDATE: Thanks to <a href="http://github.com/nerdyc">Christian Niles</a> for pointing out the SYMROOT environment variable in a pull request.  Setting this for command line builds forces Xcode to use the specified location for all build products, and updates the BUILD_DIR compiler variable.</strong></p>
<p>Steps for changing the build location in Xcode 4:</p>
<ul>
<li>Open Xcode preferences &#40;Command-,&#41;</li>
<li>Select the &#8220;Locations&#8221; tab</li>
<li>Change the &#8220;Build Location&#8221; drop down from &#8220;Place build products in derived data location&#8221; to &#8220;Place build products in locations specified by targets.&#8221;</li>
</ul>
<p>The post <a href="http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/">Cedar vs. Xcode 4 (round one: the command line)</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/cedar-vs-xcode-4-round-one-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching 3/7 queries in 0.042 seconds using apc
Object Caching 403/411 objects using apc

 Served from: pivotallabs.com @ 2013-05-22 16:24:57 by W3 Total Cache -->