iOS: How configure Xcode for arm AND simulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Travis

The build system of pjsip is capable of building the only one architecture per time according to your configuration, so you should build pjsip libraries for each architecture separately and rename them or copy then at different locations and use the built version of libraries in XCode project.

To add libraries in Xcode project you should modify appropriate '.xcconfig' file in you Xcode project or create it and assign it to appropriate project configuration (read XCode documentation for details).


Then you should add list of required libraries to '.xcconfig' file, for example, for adding base pjsip libraries (8 of 18), add following lines:

PJSIP_LDFLAGS =
PJSIP_LDFLAGS[sdk=iphoneos*] = -lpj-arm-apple-darwin9 -lpjlib-util-arm-apple-darwin9 -lpjnath-arm-apple-darwin9 -lpjsip-arm-apple-darwin9 -lpjsip-simple-arm-apple-darwin9 -lpjsip-ua-arm-apple-darwin9 -lpjsua-arm-apple-darwin9 -lpjmedia-arm-apple-darwin9
PJSIP_LDFLAGS[sdk=iphonesimulator*] = -lpj-i386-apple-darwin10.7.0 -lpjlib-util-i386-apple-darwin10.7.0 -lpjnath-i386-apple-darwin10.7.0 -lpjsip-i386-apple-darwin10.7.0 -lpjsip-simple-i386-apple-darwin10.7.0 -lpjsip-ua-i386-apple-darwin10.7.0 -lpjsua-i386-apple-darwin10.7.0 -lpjmedia-i386-apple-darwin10.7.0
OTHER_LDFLAGS = $(PJSIP_LDFLAGS) $(PUT_HERE_YOUR_EXTRA_OTHER_LDFLAGS)


Then you should define some useful custom variables pointing to paths relative to your project (read XCode documentation for details) in '.xcconfig' file, for example :
ROOT_DIR = ../../../..
BUILD_DIR = $(ROOT_DIR)/Build
PRE_BUILD_DIR = $(ROOT_DIR)/Pre-Build


Then you should add list of search paths for required libraries to '.xcconfig' file, for example, for adding search paths for base pjsip libraries (8 of 18), add following lines:
PJSIP_LIBRARY_SEARCH_PATHS =
PJSIP_LIBRARY_SEARCH_PATHS[sdk=iphoneos*] = $(PRE_BUILD_DIR)/PJSIP/armv7/libs
PJSIP_LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(PRE_BUILD_DIR)/PJSIP/i386/libs
LIBRARY_SEARCH_PATHS = $(PJSIP_LIBRARY_SEARCH_PATHS) $(PUT_HERE_YOUR_OTHER_LIBRARY_SEARCH_PATHES)


Then you should add list of header search paths for required libraries to '.xcconfig' file, for example, for adding header search paths for base pjsip libraries (8 of 18), add following lines:
PJSIP_HEADER_SEARCH_PATHS = $(ROOT_DIR)/Sources/PJSIP/pjlib/include $(ROOT_DIR)/Sources/PJSIP/pjlib-util/include $(ROOT_DIR)/Sources/PJSIP/pjnath/include $(ROOT_DIR)/Sources/PJSIP/pjsip/include $(ROOT_DIR)/Sources/PJSIP/pjmedia/include
HEADER_SEARCH_PATHS = $(PJSIP_HEADER_SEARCH_PATHS) $(PUT_HERE_YOUR_OTHER_HEADER_SEARCH_PATHS)

In examples above the only one architecture (i386) was used for simulator and the only one (armv7) was used for device, if you need to support both armv6 and armv7 architectures for device, then you should define PJSIP_LDFLAGS and PJSIP_LIBRARY_SEARCH_PATHS variables not only for different sdk (e.g. [sdk=iphoneos*]), but also for different architectures (e.g. [sdk=iphoneos*][arch=armv6])
Also in example above only 8 of 18 libraries provided by pjsip project are used, if you need others you should add appropriate libraries and search paths to corresponding variables.


As alternative approach you may use lipo command line tool (use 'man lipo' in Terminal for details) for creating fat single binary from thin binaries (i386, armv6, armv7) for each pjsip libraries and define single configuration variables in 'xcconfig' file without any [sdk=iphoneos*][arch=armv6] additions.

Regards
Andriy



On Jun 27, 2011, at 7:51 AM, Travis Miller wrote:

Hi,

I am able to run the ipjsua client on the simulator and I can compile it using export ARCH="-arch armv6" to run it on the device. However, I can't find a way to keep the two working with my Xcode. I would like to switch the Xcode targets between the Simulator and the Device. Is there anything obvious I am doing wrong or missing some steps?

I would really appreciate suggestions or pointers on this.

Thanks
<ATT00001..txt>




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux