Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode build settings not showing arch specific options?

I'm trying to add architecture specific locations for libraries in my build settings for my project. However for some reason I don't see them in the menu.


How my menu looks:

My Menu


How the menu is supposed to look

What it's supposed to look like

(Not exactly the same, but you can see how in this image they were able to select architecture specific options for the configuration setting. I'm only able to select OS specific things, not architecture)

See this page for a reference of how it should be working.

like image 817
Nathan F. Avatar asked Nov 07 '22 03:11

Nathan F.


1 Answers

I had to find this out through experimentation and trial and error. I was unable to find any documentation out there for this afaik; if there is, I would be happy to see it.

You'll have to manually edit your project.pbxproj file. Find the setting you want to change (making sure it belongs to the correct target and configuration), and change it from

LIBRARY_SEARCH_PATHS = (
    /library/search/path/1,
    /library/search/path/2,
    /library/search/path/3,
);

to

"LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=x86_64]" = (
    /library/search/path/1,
    /library/search/path/2,
    /library/search/path/3,
);

A few things to note:

  • When you add an option, make sure you add quotation marks, otherwise Xcode will not be able to parse the project.pbxproj file.
  • If you need to add more than one specific option, add another square-bracket delimited item like so [arch=x86_64].

The full list of sdks (as of this writing) comprise

iphonesimulator 
iphoneos 
watchos 
watchsimulator 
appletvos 
appletvsimulator 
macosx

Edit: Please also note that the build system distinguishes between iphoneos (iOS device) and iphonesimulator, so if a build isn't working, double check your [sdk=...] settings!

like image 88
casvaart Avatar answered Nov 14 '22 22:11

casvaart