How to use Swift Flags inside a Run Script Build Phase in Xcode?
Should be able to use wildcards in conjunction with the $OTHER_SWIFT_FLAGS
env variable.
if [[ $OTHER_SWIFT_FLAGS == *"-D MYOWNFLAG"* ]]; then
echo "execute something (e.g. change Info.plist setting value)"
fi
You can check all available environment variables by running printenv
from within a runscript phase.
The Other Swift Flags can be printed by running:
echo $OTHER_SWIFT_FLAGS
from within your runscript phase