3

I'm trying to setup a library for simulator or device building and everywhere I see explains that SDKROOT should expand to a /Developer/Platform/<>/SDKs/<>/, where <> is filled in by your project settings.

Many links on the internet explain that SDKROOT will expand to a path, but the newer versions of XCode, SDKROOT expands to "iphoneos2.2.1" - which isn't nearly as helpful (for this task).

Clearly enough if you look at apples documentation, the behavior changed:

http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Reference/XcodeBuildSettingRef/9-Revision-3.1/history.html

I confirmed the change by looking at some older documentation on my mac.

Any thoughts on how to achieve similar functionality in the latest XCode builds? My end goal is to link to a static library in platform independent ways. The header files differ on each platform, so building a fat-static library doesn't solve the problem.

Brian King
  • 2,834
  • 1
  • 27
  • 26

2 Answers2

4

In Xcode 3.2.1, it looks like SDK_DIR contains the path that used to be in SDKROOT.

cstawarz
  • 56
  • 1
0

I can't find documentation mentioning SDK_DIR anywhere. The Behavior of SDKROOT clearly changed at some point. It used to expand to a full path and now it simply expands to a short form like "iphoneos4.3". I can't find anything documenting this behavior change though and the above link is dead.

On experimenting SDKROOT is the right thing to use. It looks like it expands to the short form "iphoneos4.3" but in reality it expands to the full path at build time. I think Xcode just shortens it for display purposes, which is confusing.

mlaster
  • 417
  • 3
  • 5