title: Building for MacOSX, but linking against dylib built for iOS Simulator file
body: <p>I've just upgraded to Xcode 5 beta with the April 15 2013 commandline tools and hit the following warning when running a cmake build during the standard CMakeTestCCompiler.cmake attempt to compile a simple test program:</p>
  
  <pre><code>cmake -version
  cmake version 2.8.11.2
  
  ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib' for architecture i386
  
  lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib
  Non-fat file: libSystem.dylib is architecture: i386
  </code></pre>
  
  <p>The compile step is:</p>
  
  <pre><code>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -o /Users/temp/testCCompiler.c.o -c /Users/temp/testCCompiler.c
  
  lipo -info /Users/temp/testCCompiler.c.o 
  Non-fat file: testCCompiler.c.o is architecture: i386
  </code></pre>
  
  <p>The link step is:</p>
  
  <pre><code>/usr/local/bin/cmake -E cmake_link_script /Users/temp/link.txt --verbose=1
  </code></pre>
  
  <p>where link.txt contains:</p>
  
  <pre><code>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -Wl,-headerpad_max_install_names /Users/temp/testCCompiler.c.o -o testCCompiler
  </code></pre>
  
  <p>It seems that both testCCompiler.c.o and libSystem.dylib are i386, i386 is specified in link.txt, and i386 is the right architecture for the simulator so i'm not sure why it thinks it is building for MacOSX. Perhaps a commandline option is wrong :(.</p>
  
  <p>thanks for any help!</p>