Getting Older SDKROOT Behavior in Xcode

I'm trying to set up a library for modeling or building a device, and everywhere I see it explains that SDKROOT should expand to / Developer / Platform / </ SDK / <> /, where <> is populated according to your project settings.

Many links on the Internet explain that SDKROOT will expand to the path, but newer versions of Xcode, SDKROOT expand to "iphoneos2.2.1" - this is not so useful (for this task).

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

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

I confirmed this change by looking at some old documents on my Mac.

Any thoughts on how to achieve similar functionality in recent versions of Xcode? My ultimate goal is to link the static library with platform-independent ways. Header files vary on each platform, so creating a fat-static library does not solve the problem.

+3
iphone xcode static-libraries
source share
2 answers

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

+4
source share

I can not find the documentation that mentions SDK_DIR. The behavior of SDKROOT clearly changed at some point. It was used to expand to the full path, and now it simply expands to a short form, such as iphoneos4.3. I cannot find anything documenting this change in behavior, although the link above is dead.

When experimenting, SDKROOT is the right thing. It looks like it expands to the short form β€œiphoneos4.3”, but in fact it expands to the full path during build. I think Xcode is simply shortening it for display purposes, which is confusing.

0
source share

All Articles