diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 654d4bc58e..d275252fd5 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -2452,7 +2452,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\nDRAPE_CONF=\"old_renderer\"\nif [[ \"$LOWERED_CONFIG\" == *production* || \"$LOWERED_CONFIG\" == *adhoc* ]]; then\nCONF=\"production\"\nelif [[ \"$LOWERED_CONFIG\" == *debug* ]]; then\nCONF=\"debug\"\nelif [[ \"$LOWERED_CONFIG\" == *release* ]]; then\nif [[ \"$LOWERED_CONFIG\" == *simulator* ]]; then\nCONF=\"simulator-release\"\nelse\nCONF=\"release\"\nfi\nfi\n\nif [[ \"$LOWERED_CONFIG\" == *drape* ]]; then\necho \"Drape renderer building\"\nDRAPE_CONF=\"drape\"\nfi\n\n# Respect \"Build for active arch only\" project setting.\nif [[ \"$ONLY_ACTIVE_ARCH\" == YES ]]; then\n if [[ ! -z $CURRENT_ARCH ]]; then\n VALID_ARCHS=\"$CURRENT_ARCH\"\n fi\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF $DRAPE_CONF"; + shellScript = ". run-script-for-target.sh"; }; FA3A60E715AD5BBD00F40D20 /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -2466,7 +2466,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\nDRAPE_CONF=\"old_renderer\"\nif [[ \"$LOWERED_CONFIG\" == *production* || \"$LOWERED_CONFIG\" == *adhoc* ]]; then\n CONF=\"production\"\nelif [[ \"$LOWERED_CONFIG\" == *debug* ]]; then\n CONF=\"debug\"\nelif [[ \"$LOWERED_CONFIG\" == *release* ]]; then\n if [[ \"$LOWERED_CONFIG\" == *simulator* ]]; then\n CONF=\"simulator-release\"\n else\n CONF=\"release\"\n fi\nfi\n\nif [[ \"$LOWERED_CONFIG\" == *drape* ]]; then\n echo \"Drape renderer building\"\n DRAPE_CONF=\"drape\"\nfi\n\n# Respect \"Build for active arch only\" project setting.\nif [[ \"$ONLY_ACTIVE_ARCH\" == YES ]]; then\n if [[ ! -z $CURRENT_ARCH ]]; then\n VALID_ARCHS=\"$CURRENT_ARCH\"\n fi\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF $DRAPE_CONF"; + shellScript = ". run-script-for-target.sh"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/iphone/Maps/run-script-for-target.sh b/iphone/Maps/run-script-for-target.sh new file mode 100644 index 0000000000..53e73079b9 --- /dev/null +++ b/iphone/Maps/run-script-for-target.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# This script builds C++ core libs and inserts some private variables. +# Should be run from Run Script phase in target's settings. + +LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]` +CONF="simulator" +DRAPE_CONF="old_renderer" +if [[ "$LOWERED_CONFIG" == *production* || "$LOWERED_CONFIG" == *adhoc* ]]; then + CONF="production" +elif [[ "$LOWERED_CONFIG" == *debug* ]]; then + CONF="debug" +elif [[ "$LOWERED_CONFIG" == *release* ]]; then + if [[ "$LOWERED_CONFIG" == *simulator* ]]; then + CONF="simulator-release" + else + CONF="release" + fi +fi + +if [[ "$LOWERED_CONFIG" == *drape* ]]; then + echo "Drape renderer building" + DRAPE_CONF="drape" +fi + +# Respect "Build for active arch only" project setting. +if [[ "$ONLY_ACTIVE_ARCH" == YES ]]; then + if [[ ! -z $CURRENT_ARCH ]]; then + VALID_ARCHS="$CURRENT_ARCH" + fi +fi + +echo "Building $CONF configuration" +bash "$SRCROOT/../../tools/autobuild/ios.sh" $CONF $DRAPE_CONF