configure: ensure cuda is present if req

This commit is contained in:
Martin Pulec
2023-03-30 15:20:50 +02:00
parent 34cf791ba0
commit af1df2e376

View File

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