From af1df2e376c80a924f87f56d3736de712d1296bd Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 30 Mar 2023 15:20:50 +0200 Subject: [PATCH] configure: ensure cuda is present if req --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index ba187691c..a4a521ab8 100644 --- a/configure.ac +++ b/configure.ac @@ -349,6 +349,16 @@ remove_mwindows() { echo "$1" | sed 's/-mwindows//' | compact_spaces_pipe } +## ensures that user explicitly requested feature is present, otherwise fail +## @param $1 feature requeseted +## @param $2 feature feature found +## @param $3 error message +ensure_feature_present() { + if test "$1" = yes && test "$2" = no; then + AC_MSG_ERROR([$3]); + fi +} + # ------------------------------------------------------------------------------------------------- # GCC-specific warning flags if test "$GCC" = yes @@ -2195,6 +2205,8 @@ else HOST_CC_REPORT="" fi +ensure_feature_present "$cuda_req" "$FOUND_CUDA" "CUDA not found" + AC_SUBST(CUDA_INC) AC_SUBST(CUDA_COMPILER) AC_SUBST(CUDA_COMPUTE_ARGS)