2

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.

KWilk
  • 135
  • 8

3 Answers3

3

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.

rakmoh
  • 2,953
  • 1
  • 16
  • 14
  • Can you please provide more details on how to "remove the library that you don't want to link" ? – BlackM Mar 11 '22 at 10:11
0

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.

0

//: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

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 07 '22 at 07:19