forked from organicmaps/organicmaps
[ios] Now C++ libs are built from XCode
This commit is contained in:
parent
286d2870d0
commit
de2a86b10f
4 changed files with 113 additions and 3 deletions
|
@ -2883,6 +2883,7 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "MapsWithMe Pro" */;
|
||||
buildPhases = (
|
||||
FA3A60E715AD5BBD00F40D20 /* ShellScript */,
|
||||
1D60588D0D05DD3D006BFB54 /* Resources */,
|
||||
1D60588E0D05DD3D006BFB54 /* Sources */,
|
||||
1D60588F0D05DD3D006BFB54 /* Frameworks */,
|
||||
|
@ -2901,6 +2902,7 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = FAFB0913151215EE0041901D /* Build configuration list for PBXNativeTarget "MapsWithMe Lite" */;
|
||||
buildPhases = (
|
||||
FA78191C15C5F673009E0278 /* ShellScript */,
|
||||
FAFB06AA151215EE0041901D /* Resources */,
|
||||
FAFB08E8151215EE0041901D /* Sources */,
|
||||
FAFB08FA151215EE0041901D /* Frameworks */,
|
||||
|
@ -4163,6 +4165,19 @@
|
|||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
FA3A60E715AD5BBD00F40D20 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/bash;
|
||||
shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\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 CONF=\"release\"\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF";
|
||||
};
|
||||
FA40A8FF149B86E400AD1225 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 12;
|
||||
|
@ -4173,9 +4188,22 @@
|
|||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellPath = /bin/bash;
|
||||
shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* ]]; then\n echo \"Copy drules_proto.txt in non-production build\"\n cp \"$SRCROOT/../../data/drules_proto.txt\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/\"\nfi";
|
||||
};
|
||||
FA78191C15C5F673009E0278 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/bash;
|
||||
shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\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 CONF=\"release\"\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF";
|
||||
};
|
||||
FAFB0912151215EE0041901D /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 12;
|
||||
|
@ -4186,7 +4214,7 @@
|
|||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellPath = /bin/bash;
|
||||
shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* ]]; then\n echo \"Copy drules_proto.txt in non-production build\"\n cp \"$SRCROOT/../../data/drules_proto.txt\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/\"\nfi\nif [[ \"$LOWERED_CONFIG\" == *lite* ]]; then\n echo \"Using World file without search index\"\n mv \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/World.mwm.nosearch\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/World.mwm\"\n echo \"Using countries.txt without search support\"\n mv \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/countries.txt.nosearch\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/countries.txt\"\nfi";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
set -e -x
|
||||
|
||||
LOCAL_DIRNAME="${PWD}/$(dirname "$0")"
|
||||
LOCAL_DIRNAME="$(dirname "$0")"
|
||||
#LOCAL_DIRNAME="${PWD}/$(dirname "$0")"
|
||||
|
||||
source "$LOCAL_DIRNAME/detect_qmake.sh"
|
||||
|
||||
|
|
35
tools/autobuild/detect_xcode.sh
Normal file
35
tools/autobuild/detect_xcode.sh
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Add your paths into these arrays
|
||||
KNOWN_IOS_SDK_PATHS=( \
|
||||
/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \
|
||||
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/
|
||||
)
|
||||
|
||||
KNOWN_IOS_SDK_SIMULATOR_PATHS=( \
|
||||
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \
|
||||
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
|
||||
)
|
||||
|
||||
|
||||
# Prints path to directory with iOS SDK
|
||||
# Pameter is configuration name: <debug|release|production|simulator>
|
||||
# Returns 1 in case of not found and 0 in case of success
|
||||
PrintIOSSDKPath() {
|
||||
PATHS_ARRAY="${KNOWN_IOS_SDK_PATHS[@]}"
|
||||
if [[ $1 == "simulator" ]]; then
|
||||
for path in "${KNOWN_IOS_SDK_SIMULATOR_PATHS[@]}"; do
|
||||
if [ -d "${path}" ]; then
|
||||
echo "${path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
else
|
||||
for path in "${KNOWN_IOS_SDK_PATHS[@]}"; do
|
||||
if [ -d "${path}" ]; then
|
||||
echo "${path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Not found
|
||||
return 1
|
||||
}
|
46
tools/autobuild/ios.sh
Normal file
46
tools/autobuild/ios.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Script takes configuration as a parameter and optional clean keyword.
|
||||
# Possible configurations: debug release production
|
||||
|
||||
set -e -u -x
|
||||
|
||||
LOCAL_DIRNAME="$(dirname "$0")"
|
||||
#LOCAL_DIRNAME="${PWD}/$(dirname "$0")"
|
||||
|
||||
if [[ $# < 1 ]]; then
|
||||
echo "Usage: $0 <debug|release|production|simulator> [clean]"
|
||||
exit 1
|
||||
fi
|
||||
CONFIGURATION="$1"
|
||||
|
||||
source "$LOCAL_DIRNAME/build.sh"
|
||||
source "$LOCAL_DIRNAME/detect_xcode.sh"
|
||||
|
||||
SDK_ROOT="$(PrintIOSSDKPath "$CONFIGURATION")"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Is XCode installed? Check tools/autobuild/detect_xcode.sh script"
|
||||
exit 1
|
||||
fi
|
||||
export SDK_ROOT
|
||||
|
||||
MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonedevice-llvm"
|
||||
QMAKE_PARAMS="CONFIG+=${CONFIGURATION}"
|
||||
if [[ $CONFIGURATION == "production" ]] ; then
|
||||
QMAKE_PARAMS="$QMAKE_PARAMS CONFIG+=release"
|
||||
fi
|
||||
|
||||
SHADOW_DIR_BASE="$LOCAL_DIRNAME/../../../omim-iphone"
|
||||
|
||||
if [[ $CONFIGURATION == "simulator" ]]; then
|
||||
SHADOW_DIR="${SHADOW_DIR_BASE}sim-debug"
|
||||
MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonesimulator-clang"
|
||||
else
|
||||
SHADOW_DIR="${SHADOW_DIR_BASE}-${CONFIGURATION}"
|
||||
MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonedevice-llvm"
|
||||
fi
|
||||
|
||||
if [[ $# > 1 && "$2" == "clean" ]] ; then
|
||||
echo "Cleaning $CONFIGURATION configuration..."
|
||||
rm -rf "$SHADOW_DIR"
|
||||
else
|
||||
BuildQt "$SHADOW_DIR" "$MKSPEC" "$QMAKE_PARAMS" || ( echo "ERROR while building $CONFIGURATION config"; exit 1 )
|
||||
fi
|
Loading…
Add table
Reference in a new issue