Skip to content

Commit

Permalink
Fix build failing when CUDA not found
Browse files Browse the repository at this point in the history
Use add_languages to conditionally use CUDA.
  • Loading branch information
bmerry committed Aug 22, 2023
1 parent 4b50d0b commit 39ae4cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

project(
'spead2',
'cpp', 'cuda',
'cpp',
meson_version : '>=1.2.0',
version : '4.0.0b1',
license : 'LGPL-3.0-or-later',
Expand Down Expand Up @@ -110,7 +110,11 @@ use_ibv = ibv_dep.found() and rdmacm_dep.found()
# handling that uses pcap-config if pkgconfig doesn't find it.
pcap_dep = dependency('pcap', required : get_option('pcap'))
cap_dep = dependency('libcap', required : get_option('cap'), disabler : true)
cuda_dep = dependency('cuda', required : get_option('cuda'), disabler : true)
if add_languages('cuda', required : get_option('cuda'))
cuda_dep = dependency('cuda', required : get_option('cuda'), disabler : true)
else
cuda_dep = disabler()
endif

# Optional features
use_ibv_hw_rate_limit = get_option('ibv_hw_rate_limit').require(
Expand Down

0 comments on commit 39ae4cc

Please sign in to comment.