C++ Compilter Configuration Disabled in iOS Project Settings
Can someone please explain why C++ Compiler Configuration
is disabled in the iOS project settings (see screenshot below), but not in the Android project settings? Moreover, should I expect any issues if I try to set the configuration to something other than Release
inside a build script (via PlayerSettings.SetIl2CppCompilerConfiguration)? I am using Unity 2019.3.0f6 Plus on Windows 10 Pro (1903).
Answer by JoshPeterson · Apr 06, 2020 at 11:12 AM
This option is disable for iOS project because the actual compilation of the C++ code IL2CPP generates is done in Xcode, not via Unity. Therefore, the build configuration setting in Xcode controls this option. The Android build, on the other hand, it driven by the Unity Editor, so this setting applies.
Changing this setting in a build script will apply it to all platforms where it matters. That is, it will apply for Android, but not for iOS.
Ah, okay that makes sense. Could you clarify what this means for some other build settings? I assume that code stripping of managed assemblies still happens in the Unity Editor, so using PlayerSettings.Set$$anonymous$$anagedStrippingLevel()
would apply to iOS, but what about PlayerSettings.stripEngineCode
? Also, how can it be that am I able to run IL2CPP-backed iOS builds on my Windows machine if the build requires Xcode?
The stripping level and strip engine code options do apply on iOS, because both happen before the C++ compilation.
If you are building for iOS on Windows, the build output is an Xcode project. You will need to copy that project to a macOS computer to actually build it.
Excellent, thanks for clarifying. I only run iOS builds locally to troubleshoot Cloud Build errors, so I guess I've never technically made a complete iOS build locally before.
Also, I know this is kind of going on a tangent now, but do you have any idea why calling PlayerSettings.SetIl2CppCompilerConfiguration()
in a Cloud Build pre-export method would not have any effect?
Sorry, I'm not sure how this plays with cloud build at all.
Okay, no worries, guess I'll post a separate question. Thanks again for your answer!
Your answer
![](https://koobas.hobune.stream/wayback/20220612230626im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
iOS crash during game play. il2cpp related 0 Answers
Xcode - Mach-O Linker Error after upgrade to Unity 2019.4 (LTS) 0 Answers
iOS, Photon and IL2CPP build error 0 Answers
Can I change the placement path of "Data" folder? 0 Answers
Help! Null exception and "filename currently not available on il2cpp Line: -1", 1 Answer