I have a question about whether a behavior of SwiftPM(or Xcode) is correct or not. When a swift package use compilation conditions like "# if DEBUG" in the source code, I think a user of the package like a Xcode project can not inject its compilation conditions to the package from its project configuration, but I observed that the package's conditions work when the condition's name is prefix matched to the project configuration name. Does it correct?
- Create a swift package.
- Implement # if DEBUG #else #endif.
- Create some Xcode project.
- Setup dependency to the package.
- Add breakpoints to the condition branches.
- Create another configuration named "Test".
- Set "DEBUG" compilation conditions to the "Test" configuration.
- Run with "Debug" configuration, and DEBUG branch will be executed.
- Run with "Test" configuration, and DEBUG branch will not be executed.
If you make a configuration which named "Debug2" or "DebugFooBar", the # if DEBUG branch will be executed.