Skip to content

Commit e3df2b8

Browse files
As nvbench.main links to nvbench as INTERFACE only, it no longer consumes usage reqs of nvbench
Because of this nvbench.main was no longer consuming dependence on CUDA::toolkit include dirs. This PR creates a small interface target for NVBench’s public deps (CUDA/CUPTI/NVML) and links it to nvbench.main privately, while keeping NVBench headers SYSTEM only on nvbench.
1 parent ea02b36 commit e3df2b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nvbench/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ target_link_libraries(nvbench
9595
nvbench_json
9696
)
9797

98+
# Public dependency interface to re-use on internal targets without
99+
# making NVBench headers system for those builds.
100+
add_library(nvbench.public_deps INTERFACE)
101+
target_link_libraries(nvbench.public_deps INTERFACE ${ctk_libraries})
102+
98103
# ##################################################################################################
99104
# * conda environment -----------------------------------------------------------------------------
100105
rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
@@ -124,6 +129,8 @@ add_library(nvbench.main OBJECT main.cu)
124129
nvbench_config_target(nvbench.main)
125130
# Propagate `nvbench` to consumers but keep NVBench's own build warning-visible.
126131
target_link_libraries(nvbench.main INTERFACE nvbench)
132+
# Ensure CUDA/CUPTI/NVML include dirs are visible for nvbench.main's build.
133+
target_link_libraries(nvbench.main PRIVATE nvbench.public_deps)
127134
# Add NVBench's headers privately so the object library itself sees warnings.
128135
target_include_directories(nvbench.main
129136
PRIVATE

0 commit comments

Comments
 (0)