1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
From: Christian Kastner <ckk@debian.org>
Date: Sun, 29 Jun 2025 18:13:26 +0200
Subject: Add missing GTest includes and linking
The missing gtest.h causes a compile error because of GTEST_SKIP use,
which also seems to be the cause of a linking issue.
Forwarded: https://github.com/ROCm/hipSPARSE/pull/634
---
clients/benchmarks/CMakeLists.txt | 4 +++-
clients/include/testing_bsrmv.hpp | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/clients/benchmarks/CMakeLists.txt b/clients/benchmarks/CMakeLists.txt
index 8470391..b7fc5e6 100644
--- a/clients/benchmarks/CMakeLists.txt
+++ b/clients/benchmarks/CMakeLists.txt
@@ -21,6 +21,8 @@
#
# ########################################################################
+find_package(GTest REQUIRED)
+
set(HIPSPARSE_BENCHMARK_SOURCES
client.cpp
hipsparse_arguments_config.cpp
@@ -46,7 +48,7 @@ target_compile_options(hipsparse-bench PRIVATE -Wno-deprecated -Wno-unused-comma
target_include_directories(hipsparse-bench PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>)
# Target link libraries
-target_link_libraries(hipsparse-bench PRIVATE roc::hipsparse)
+target_link_libraries(hipsparse-bench PRIVATE GTest::GTest roc::hipsparse)
# Add OpenMP if available
if(OPENMP_FOUND AND THREADS_FOUND)
diff --git a/clients/include/testing_bsrmv.hpp b/clients/include/testing_bsrmv.hpp
index a81bc5c..b0bf9cc 100644
--- a/clients/include/testing_bsrmv.hpp
+++ b/clients/include/testing_bsrmv.hpp
@@ -35,6 +35,7 @@
#include "utility.hpp"
#include <cmath>
+#include <gtest/gtest.h>
#include <hipsparse.h>
#include <string>
|