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.
This commit is contained in:
Brad King 2022-11-14 14:22:20 -05:00
parent f8107e7c6b
commit 7ef3638454
10 changed files with 49 additions and 1 deletions

1
.gitlab/.gitignore vendored
View File

@ -8,6 +8,7 @@
/mingw
/msvc*
/ninja*
/openmp
/open-watcom*
/python*
/qt*

View File

@ -1,3 +1,6 @@
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")

View File

@ -1,3 +1,6 @@
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")

View File

@ -1,3 +1,6 @@
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")

View File

@ -0,0 +1 @@
. .gitlab/ci/openmp-env.sh

View File

@ -1,3 +1,4 @@
. .gitlab/ci/openmp-env.sh
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -1,3 +1,4 @@
. .gitlab/ci/openmp-env.sh
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

3
.gitlab/ci/openmp-env.sh Normal file
View File

@ -0,0 +1,3 @@
.gitlab/ci/openmp.sh
export CMAKE_PREFIX_PATH=$PWD/.gitlab/openmp${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
export DYLD_LIBRARY_PATH=$PWD/.gitlab/openmp/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}

32
.gitlab/ci/openmp.sh Executable file
View File

@ -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

View File

@ -143,7 +143,7 @@
- ninja --version
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
.cmake_build_macos:
stage: build