KWilk
KWilk

Reputation: 145

How do I force the Xcode compiler to ignore a library when building for the iOS simulator

I am getting a series of linker errors when building a specific library for the iOS simulator. The source of the issue seems to the be architecture that the library was build for which seems to cause issue when compiling for the iOS simulator. The specific library is the Aurasma augmented reality library.

My question would be this, is there a way to not compile a library when the code is being compiled for the iOS simulator? Although I do have some code that is dependent on that library I could easily use an #ifdef statement to only use that code when NOT in the iOS simulator.

I can easily admit I may not understand the full root of the issue. I have attempted some solutions using a -weak_library linker flag with no specific progress or success.

Upvotes: 3

Views: 2156

Answers (3)

Amer Hwitat
Amer Hwitat

Reputation: 1

//:configuration = ReleaseForProfiling
CODE_SIGN_IDENTITY = 
CODE_SIGN_IDENTITY[sdk=iphoneos*] = 
DEVELOPMENT_TEAM = 
PROVISIONING_PROFILE_SPECIFIER[sdk=iphonesimulator*] = 
PROVISIONING_PROFILE[sdk=iphonesimulator*] = 

//:configuration = Release
CODE_SIGN_IDENTITY = 
CODE_SIGN_IDENTITY[sdk=iphoneos*] = 
DEVELOPMENT_TEAM = 
PROVISIONING_PROFILE_SPECIFIER[sdk=iphonesimulator*] = 
PROVISIONING_PROFILE[sdk=iphonesimulator*] = 

//:configuration = Debug
CODE_SIGN_IDENTITY = 
CODE_SIGN_IDENTITY[sdk=iphoneos*] = 
DEVELOPMENT_TEAM = 
PROVISIONING_PROFILE_SPECIFIER[sdk=iphonesimulator*] = 
PROVISIONING_PROFILE[sdk=iphonesimulator*] = 

//:configuration = ReleaseForRunning
CODE_SIGN_IDENTITY = 
CODE_SIGN_IDENTITY[sdk=iphoneos*] = 
DEVELOPMENT_TEAM = 
PROVISIONING_PROFILE_SPECIFIER[sdk=iphonesimulator*] = 
PROVISIONING_PROFILE[sdk=iphonesimulator*] = 

//:completeSettings = some
CODE_SIGN_ENTITLEMENTS
CODE_SIGN_IDENTITY
CODE_SIGN_STYLE
DEVELOPMENT_TEAM
OTHER_CODE_SIGN_FLAGS
PROVISIONING_PROFILE_SPECIFIER
PROVISIONING_PROFILE

Upvotes: 0

Amer Hwitat
Amer Hwitat

Reputation: 1

I had the same problem, what I did is configured the unity project to compile to a simulator SDK, then in Xcode I changed the target>Build settings to compile to release , if I remember well and bingo the project worked and I had the unsigned ipa file.

Upvotes: 0

rakmoh
rakmoh

Reputation: 2963

In XCode, you can configure a separate library list for each iOS/simulator sdk. Here are the step to configure this:

  • Click on your peoject->Target->Build Settings->Linking->Other Linker Flags
  • Click "+" for your build configuration (e.g. Debug) under Other Linker Flags.
  • For the new entry under your build configuration select "Any iOS Simulator SDK" and remove the library that you don't want to link.
  • You can add as many entries as you want by clicking the "+" button on the build configuration and configure the libraries that you want for any particular sdk.

Same technique can be applied for other settings in XCode for a target.

Upvotes: 3

Related Questions