There are two different things:
- library indexing for code-sense, explained in my previous post
- library selection for build and link, explained below.
The pins_arduino.h specific to the board selected —e.g. Arduino Leonardo— is managed with the choice of the variants folder...
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/leonardo
... through the boards.txt file...
leonardo.build.variant=leonardo
embedXcode considers the sketch as a standard C++ program —actually, a library of main.cpp— and doesn't perform under-the-hood hidden processes. Everything is managed by a makefile and the GNU GCC tools-chain.
The biggest obstacle for add-ons like Jante's for Eclipse or mine for Xcode lies on those under-the-hood hidden processes done by the Arduino IDE.
Or to put it with other words: the Arduino team should understand that Arduino is actually two things (from a software point of view)
- an easy-to-use but limited IDE
- and a framework, inspired by/similar to Wiring.
That framework should remain usable with any standard IDE like Eclipse, NetBeans, Visual Studio or Xcode, to name a few. Hence this very thread.