diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-12-08 17:47:18 +0300 |
---|---|---|
committer | Ilya Zverev <ilya@zverev.info> | 2017-07-04 11:26:12 +0300 |
commit | 93035f266a9b1efa135e16eacb114ec5d73959c4 (patch) | |
tree | 951076ed1ca531dacb5dd0b5429563183272e5dd /tools/autobuild | |
parent | 5830ef2737b73a58bd6bf1f0a1fd7542e119221d (diff) |
The MAPS.ME.Designer tool for DRAPE 2.0
Diffstat (limited to 'tools/autobuild')
-rw-r--r-- | tools/autobuild/build_designer.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tools/autobuild/build_designer.sh b/tools/autobuild/build_designer.sh new file mode 100644 index 0000000000..2f5b77c11a --- /dev/null +++ b/tools/autobuild/build_designer.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -e -x -u + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized + +source "$MY_PATH/detect_qmake.sh" + +# Prints number of cores to stdout +GetCPUCores() { + case "$OSTYPE" in + # it's GitBash under Windows + cygwin) echo $NUMBER_OF_PROCESSORS + ;; + linux-gnu) grep -c ^processor /proc/cpuinfo 2>/dev/null + ;; + darwin*) sysctl -n hw.ncpu + ;; + *) echo "Unsupported platform in $0" + exit 1 + ;; + esac + return 0 +} + + +# Replaces "/cygwin/c" prefix with "c:" one on Windows platform. +# Does nothing under other OS. +# 1st param: path to be modified. +StripCygwinPrefix() { + if [[ $(GetNdkHost) == "windows-x86_64" ]]; then + echo "c:`(echo "$1" | cut -c 12-)`" + return 0 + fi + + echo "$1" + return 0 +} + +# 1st param: shadow directory path +# 2nd param: mkspec +# 3rd param: additional qmake parameters +BuildQt() { + ( + SHADOW_DIR="$1" + MKSPEC="$2" + QMAKE_PARAMS="$3" + + mkdir -p "$SHADOW_DIR" + cd "$SHADOW_DIR" + echo "Launching qmake..." + # This call is needed to correctly rebuild c++ sources after switching between branches with added or removed source files. + # Otherwise we get build errors. + "$QMAKE" -r CONFIG-=sdk CONFIG+=map_designer "$QMAKE_PARAMS" -spec "$(StripCygwinPrefix $MKSPEC)" "$(StripCygwinPrefix $MY_PATH)/../../omim.pro" +# make clean > /dev/null || true + make -j $(GetCPUCores) + ) +} |