Hello all,
I’ve integrated Unity as a library into a workspace and it’s now a dependency of my main project, that is also in this workspace. As it is, this main project uses several different build configurations and depending on the selected build configuration, e.g., different backend endpoints are targeted.
Now, Unity features the following build configurations, when it’s exported: Debug, ReleaseForProfiling, ReleaseForRunning and Release.
Per default Xcode tries to match build configuration on the basis of their names for dependent frameworks. That means that the main project build configuration “Debug” will map to the Unity Framework build configuration “Debug”, because their names match. The thing is that my main project does not have any build configurations that exactly match the names of the build configurations of the Unity Framework.
My goal is to map a build configuration from the main project to a build configuration from the Unity library. So when a specific main project build configuration is selected, the Unity Framework is build with a specific build configuration of my choosing.
What I found so far is that Xcode falls back to whatever is set in “Project > Unity-iPhone > Info (Tab) > Use {config} for command-line builds”, when a build configuration cannot be mapped via their names.
Maybe someone has already dealt with a similar problem and can shed some light on this. As far as I can tell, there is no way to explicitly map a main project build configuration to a Unity Framework build configuration via e.g. “Targets > main-target > Build Settings (Tab)”.
The cleanest solution I’ve come up so far is to duplicate the build configurations of the Unity library to match the names of the main project build configurations. In Xcode this is quite easy, because there is a menu entry “Duplicate”, which duplicates existing build configurations. Unfortunately, this is not supported by PBXProject, if I wanted to create these build configurations via PostProcessBuild.
Kind regards.