diff --git a/projects/rocthrust/cmake/Dependencies.cmake b/projects/rocthrust/cmake/Dependencies.cmake index 6044443c641c..0425fe160b10 100644 --- a/projects/rocthrust/cmake/Dependencies.cmake +++ b/projects/rocthrust/cmake/Dependencies.cmake @@ -443,6 +443,10 @@ if(BUILD_BENCHMARK) if(CMAKE_CXX_COMPILER_LAUNCHER) set(EXTRA_CMAKE_ARGS "${EXTRA_CMAKE_ARGS} -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}") endif() + + # FetchContent runs in-process, so rocthrust's BUILD_BENCHMARK=ON leaks into + # rocrand and causes its benchmarks to build. Suppress that here. + set(BUILD_BENCHMARK OFF) FetchContent_Declare( rocrand @@ -454,6 +458,7 @@ if(BUILD_BENCHMARK) LOG_INSTALL TRUE ) FetchContent_MakeAvailable(rocrand) + set(BUILD_BENCHMARK ON) if(NOT TARGET roc::rocrand) add_library(roc::rocrand ALIAS rocrand) endif()