Re: Finding os version at compile time and os version at runtime?
Re: Finding os version at compile time and os version at runtime?
- Subject: Re: Finding os version at compile time and os version at runtime?
- From: Jerry LeVan <email@hidden>
- Date: Sat, 15 Dec 2007 22:25:42 -0500
On Dec 15, 2007, at 9:48 PM, John Engelhart wrote:
On Dec 15, 2007, at 8:06 PM, Jerry LeVan wrote:
Hi,
I have an app I am trying to maintain with one set of sources.
The app uses the quartz filter manager and some leopard pdfkit
stuff that is not available in the 10.4 universal sdk.
I would like to be able to detect the target os version at
compile time so I can prevent the 10.5 stuff from compiling
when I am building a universal version. ( It is all in
a single subroutine).
I also need to be able to detect at runtime if the app
is running a version < 10.5 so I can disable the menu
that invokes the 10.5 code.
Is there a standard way for doing both of these tasks?
I've had to deal with this a bit myself. You can see the results in
my open source project athttp://regexkit.sourceforge.net/
Specifically, you'll want to examine the file that's in 'Source/
Build/Xcode/RegexKit Build Settings.xcconfig', which I use to keep a
lot of the projects Xcode tunables where they can be commented,
instead of inside the .xcodeproj project. I source the .xcconfig
file at the project level by setting the Project > Edit Project
Settings > Build (tab) > Based On (drop down menu, lower right).
John,
While I chew on what you said...
I have a temp workaround.
In the universal build "parameters" section I simply added an
addition cflag "-DUNIVERSAL" and then #ifdef'ed the appropriate
hunk(s) of code.
In the nonuniversal build (Leopard) I did not define the additional
cflag.
I think I will be able to use the respondToSelector for runtime
considerations.
Thanks,
Jerry
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden