Compiling Orx on Xcode 4

edited August 2014 in General discussions
After tinkering with Xcode 4 on the Mac for a couple of days and trying to get orx to compile under CodeLite for Mac, I have some across a couple of gotchas.

On the Mac, Xcode uses the MacOSX sdk. There could be various versions and they could be in various locations. This make it difficult to have a standard build configuration under orx. Though once you work out the basics of building on the Mac, there are less things to look out for.

It appears that previous versions of the MacOSX*.sdk used to live under /Developer/SDKs/
The orx build on bitbucket at the time of writing is configured to look for the following SDK and path: /Developer/SDKs/MacOSX10.6.sdk

On your Mac, this sdk version and path simply may not exist, especially if your Mac is newer or you have upgraded. From what I have read, newer SDKs are now being packaged up under the Xcode.app application folder, which is a little cheeky.

You have two choices:
1) Download the expected SDK from the web and save it to the location expected by the orx project build configurations.
2) Change the config to point to an SDK hidden in the Xcode folders.

You'll need to get your terminal running and go hunting under your Xcode application folder to see what SDKs are available. In my case, sdks were located at:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

So you can change your Xcode compiler sdk paths to:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk;

Now orx should compile.

Comments

  • edited August 2014
    Thanks for the details!

    Now that the thread branch got merged back into default, I'm about to update to XCode 5 / OS X 10.9 in the coming days.
    We'll see if XCode 5 breaks things further. ;)
  • edited August 2014
    Today I fixed most issues with the premake-generated build files for OS X/10.9. There are a few warnings left, but they're actually part of premake's internal configuration, I'll fix them later.

    Lemme know if you have any issues.
  • edited August 2014
    Hmm errors with 10.8, I'll need to get 10.9 down.
  • edited August 2014
    Although I'm probably confusing the os version with sdk version, but overall I have no clue what I'm doing. :)

    I'll press on.
  • edited August 2014
    Ah that's annoying. :(

    There shouldn't be any explicit SDK mention anymore, unless premake adds them at some point (which would surprise me, but heh).

    Could you list the steps you followed + logs?
  • edited August 2014
    Cool so the mac/xcode project shipping under orx won't work but deleting the mac/xcode folder and creating a new one via premake (http://orx-project.org/wiki/en/orx/tutorials/community/sausage/using-premake-to-create-build-projects) will compile orx nicely.

    Because the premake doesn't mention sdk, orx and orxlib projects will need to be set to use "Latest MacOSX SDK". Otherwise you'll see build errors like missing "TargetConditionals.h".
  • edited September 2014
    Thanks for the report.

    Apparently the missing SDK issue will disappear with newer versions of OSX/XCode but there's also a patch for premake4 that allows to correct this and even add iOS support. I'll investigate this shortly.
Sign In or Register to comment.