The flags like #if DEBUG ... endif are dependent on the Active Compilation Conditions. So if they say DEBUG the enclosed code block will be executed, otherwise not. Now I have the phenomenon that a #DEBUG block in a Package does not evaluate these conditions. It rather depends on the name of the configuration used to build.
So if I build my app with Active Compilation Condition set to DEBUG, but the configuration name is something like App-Release, the DEBUG block in my Package is not added/executed. The ones which are directly in the project are added.
Vice versa if the Compilation Condition say RELEASE but the configuration is called App-Debug the blocks in the Package are added to the compilation, but the ones in the project itself are not
It suffices that the config name contains the word Debug for this to happen. E.g. the configuration App-Release-Debug (I know that this would be stupid, but it is for demonstrating purposes) will cause the Packages to include the DEBUG blocks.
This happens no matter what you set in the Build Settings of the project and/or target.
The Packages are added via GitHub/GitLab Source Control with SPM.
Any ideas why this behaves like it does? It doesn't seem like it should...