From e5ec1330883e4a04b1953b45828be6f2a6d1a048 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 15 Oct 2024 16:18:21 +0800 Subject: [PATCH] CI: Should not set GMT_USE_THREADS if optional package are not installed (#8601) --- ci/config-gmt-unix.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/config-gmt-unix.sh b/ci/config-gmt-unix.sh index b7bdf83f261..70a9645ae30 100755 --- a/ci/config-gmt-unix.sh +++ b/ci/config-gmt-unix.sh @@ -9,7 +9,6 @@ set (CMAKE_INSTALL_PREFIX "$ENV{INSTALLDIR}") set (GSHHG_ROOT "$ENV{COASTLINEDIR}/gshhg") set (DCW_ROOT "$ENV{COASTLINEDIR}/dcw") -set (GMT_USE_THREADS TRUE) set (GMT_ENABLE_OPENMP TRUE) # Always use the 'static' data server in CI. @@ -21,6 +20,12 @@ set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement ${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}") EOF +if [ "$EXCLUDE_OPTIONAL" = "true" ]; then + echo 'set (GMT_USE_THREADS TRUE)' >> cmake/ConfigUser.cmake +else + echo 'set (GMT_USE_THREADS FALSE)' >> cmake/ConfigUser.cmake +fi + # Set OpenMP_ROOT so that CMake can find the libomp header and library on macOS if [[ "$RUNNER_OS" == "macOS" ]]; then echo "set (OpenMP_ROOT $(brew --prefix)/opt/libomp/)" >> cmake/ConfigUser.cmake