# 默认没有 cuda %bcond_without cuda %global have_cuda 0 # 如果有 cuda 且为以下架构再设置 %if %{without cuda} %ifarch x86_64 aarch64 %global have_cuda 1 %endif %endif # 检查是否为 1 %if %{have_cuda} BuildRequires: cuda-nvcc %endif