Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fc22c6da5 | |||
| 3345984f1f |
@@ -0,0 +1,65 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Thu Aug 14 15:28:19 2025 +0200
|
||||
Subject: Make use of system-provided gtest USE_SYSTEM_GTEST is set
|
||||
Patch-mainline: Not yet
|
||||
Git-commit: f695634372d6d262fb495529f12c32ea97c4a6f2
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
tests/rocm_smi_test/CMakeLists.txt | 30 +++++++++++++++++++-----------
|
||||
1 file changed, 19 insertions(+), 11 deletions(-)
|
||||
diff --git a/tests/rocm_smi_test/CMakeLists.txt b/tests/rocm_smi_test/CMakeLists.txt
|
||||
index 2253327..bc565cb 100755
|
||||
--- a/tests/rocm_smi_test/CMakeLists.txt
|
||||
+++ b/tests/rocm_smi_test/CMakeLists.txt
|
||||
@@ -10,6 +10,8 @@ endif()
|
||||
# Required Defines first:
|
||||
option(INSTALL_GTEST "Install GTest (only useful if GTest is not already installed)" OFF)
|
||||
|
||||
+option(USE_SYSTEM_GTEST "Use system GTest" OFF)
|
||||
+
|
||||
message("")
|
||||
message("Build Configuration:")
|
||||
message("-----------BuildType: " ${BUILD_TYPE})
|
||||
@@ -36,13 +38,17 @@ set(CMAKE_INSTALL_RPATH
|
||||
${CMAKE_INSTALL_RPATH}
|
||||
${RSMITST_RPATH})
|
||||
|
||||
-# Download and compile googletest
|
||||
-include(FetchContent)
|
||||
-FetchContent_Declare(
|
||||
- googletest
|
||||
- GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
- GIT_TAG v1.14.0)
|
||||
-FetchContent_MakeAvailable(googletest)
|
||||
+if(USE_SYSTEM_GTEST)
|
||||
+ find_package( GTest REQUIRED )
|
||||
+else()
|
||||
+ # Download and compile googletest
|
||||
+ include(FetchContent)
|
||||
+ FetchContent_Declare(
|
||||
+ googletest
|
||||
+ GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
+ GIT_TAG v1.14.0)
|
||||
+ FetchContent_MakeAvailable(googletest)
|
||||
+endif()
|
||||
|
||||
# Other source directories
|
||||
aux_source_directory(${SRC_DIR}/functional functionalSources)
|
||||
@@ -74,8 +80,10 @@ install(FILES rsmitst.exclude
|
||||
DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
|
||||
COMPONENT ${TESTS_COMPONENT})
|
||||
|
||||
-# install googletest libraries with tests
|
||||
-install(TARGETS gtest gtest_main
|
||||
- DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
|
||||
- COMPONENT ${TESTS_COMPONENT})
|
||||
+if(NOT USE_SYSTEM_GTEST)
|
||||
+ # install googletest libraries with tests
|
||||
+ install(TARGETS gtest gtest_main
|
||||
+ DESTINATION ${SHARE_INSTALL_PREFIX}/rsmitst_tests
|
||||
+ COMPONENT ${TESTS_COMPONENT})
|
||||
+endif()
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
|
||||
Name: rocm-smi
|
||||
Version: %{rocm_version}
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: ROCm System Management Interface Library
|
||||
|
||||
License: MIT AND NCSA
|
||||
URL: https://github.com/ROCm/%{upstreamname}
|
||||
Source0: %{url}/archive/rocm-%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz
|
||||
Patch0: 0001-rocm-smi-fix-empty-return.patch
|
||||
Patch1: Make-use-of-system-provided-gtest-USE_SYSTEM_GTEST-is-set.patch
|
||||
|
||||
%if 0%{?rhel} || 0%{?suse_version}
|
||||
ExclusiveArch: x86_64
|
||||
@@ -39,6 +40,13 @@ BuildRequires: doxygen-latex >= 1.9.7
|
||||
%endif
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libdrm-devel
|
||||
%if %{with test}
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: gtest = 1.14.0
|
||||
%else
|
||||
BuildRequires: gtest-devel
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
The ROCm System Management Interface Library, or ROCm SMI library, is part of
|
||||
@@ -77,7 +85,8 @@ sed -i -e 's@env python3@python3@' python_smi_tools/rsmiBindingsInit.py.in
|
||||
%build
|
||||
%cmake -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF -DCMAKE_INSTALL_LIBDIR=%{_lib} \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=TRUE \
|
||||
-DBUILD_TESTS=%build_test
|
||||
-DBUILD_TESTS=%build_test \
|
||||
-DUSE_SYSTEM_GTEST=On
|
||||
|
||||
%cmake_build
|
||||
|
||||
@@ -118,6 +127,12 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Aug 14 2025 Egbert Eich <eich@suse.com> - 6.4.3-2
|
||||
- Require googletest package when building with test.
|
||||
- Fix build to not attempt to download googletest sources.
|
||||
Add: Make-use-of-system-provided-gtest-USE_SYSTEM_GTEST-is-set.patch
|
||||
- On SUSE limit gtest to version 1.14.0.
|
||||
|
||||
* Thu Aug 7 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.3-1
|
||||
- Update to 6.4.3
|
||||
- remove debian dir
|
||||
|
||||
Reference in New Issue
Block a user