Skip to content

Commit 759df47

Browse files
Suppress compiler flag check diagnostic messages if NVBench is used as dep
When NVBench is used as a dependency, e.g., via CPMAddPackage, suppress diagnostic messages emitted by `check_cxx_compiler_flags` per #235
1 parent 080052a commit 759df47

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/NVBenchConfigTarget.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ set_target_properties(nvbench.build_interface PROPERTIES
2323

2424
function(nvbench_add_cxx_flag target_name type flag)
2525
string(MAKE_C_IDENTIFIER "NVBench_CXX_FLAG_${flag}" var)
26+
if (NOT ${NVBench_TOPLEVEL_PROJECT})
27+
set(CMAKE_REQUIRED_QUIET ON)
28+
endif()
2629
check_cxx_compiler_flag(${flag} ${var})
2730

2831
if (${${var}})

0 commit comments

Comments
 (0)