summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-07-17 16:59:34 +0200
committerAnand Thakker <github@anandthakker.net>2018-07-20 10:58:50 -0400
commit1985b893b7c50f56e10ecc07776d60103a5a3e5b (patch)
tree83f42d3e3b0674d1ae8bc45cbd6a4ab310d94c12 /scripts
parent418bcc2f2199cfa38291a9a5b9a71180ddd8deea (diff)
downloadqtlocation-mapboxgl-1985b893b7c50f56e10ecc07776d60103a5a3e5b.tar.gz
[build] vendor Google Test
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vendor/gtest.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/vendor/gtest.sh b/scripts/vendor/gtest.sh
new file mode 100755
index 0000000000..3bae5266fb
--- /dev/null
+++ b/scripts/vendor/gtest.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
+
+NAME=gtest
+VERSION=1.8.0
+ROOT=googletest-release-1.8.0/googletest
+
+download "https://github.com/google/googletest/archive/release-$VERSION.tar.gz"
+init
+STRIP_COMPONENTS=2 extract --exclude "gtest-all.cc" --exclude "gtest_main.cc" "$ROOT/include/*.h" "$ROOT/src" "$ROOT/LICENSE"
+
+for FILE in $(find include src -name "*.h" -o -name "*.cc"); do
+ sed -e 's/^#include \"src\/\([^\"]\{1,\}\)\"/#include "\1"/' \
+ -e 's/^#include \"\(gtest\/[^\"]\{1,\}\)\"/#include <\1>/' \
+ "$FILE" > "$FILE.bak" && mv "$FILE.bak" "$FILE"
+done
+
+file_list include src -name "*.h" -o -name "*.cc"
+