summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/openmp.sh
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-14 19:22:20 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-14 19:26:10 (GMT)
commit7ef36384542c5836d0610bb515fdc7592193cf93 (patch)
treeee39a7130bc4633b01a688058c72a6a73ad94b3d /.gitlab/ci/openmp.sh
parentf8107e7c6bc007d6b00a2ba11dfd685a4606824a (diff)
downloadCMake-7ef36384542c5836d0610bb515fdc7592193cf93.zip
CMake-7ef36384542c5836d0610bb515fdc7592193cf93.tar.gz
CMake-7ef36384542c5836d0610bb515fdc7592193cf93.tar.bz2
ci: Enable FindOpenMP tests on macOS Ninja and Makefiles jobs
Since Apple does not distribute the OpenMP header and library with its AppleClang compiler, download them as part of the jobs.
Diffstat (limited to '.gitlab/ci/openmp.sh')
-rwxr-xr-x.gitlab/ci/openmp.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/.gitlab/ci/openmp.sh b/.gitlab/ci/openmp.sh
new file mode 100755
index 0000000..f411338
--- /dev/null
+++ b/.gitlab/ci/openmp.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+baseurl="https://cmake.org/files/dependencies/openmp"
+
+case "$(uname -s)-$(uname -m)" in
+ Darwin-*)
+ shatool="shasum -a 256"
+ sha256sum="6eef660db7a085a04f87e4aac79da9f37d26ff0fb17c8781d3a21bd5244997e9"
+ filename="openmp-12.0.1-darwin20-Release"
+ # tarball contains usr/local/
+ strip_components=--strip-components=2
+ ;;
+ *)
+ echo "Unrecognized platform $(uname -s)-$(uname -m)"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly sha256sum
+
+readonly tarball="$filename.tar.gz"
+
+cd .gitlab
+mkdir -p openmp
+
+echo "$sha256sum $tarball" > openmp.sha256sum
+curl -OL "$baseurl/$tarball"
+$shatool --check openmp.sha256sum
+tar -C openmp $strip_components -xzf $tarball
+rm $tarball openmp.sha256sum