diff --git a/CHANGELOG.md b/CHANGELOG.md index a52079dc..e03b70e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,9 @@ the version. Like `hipObjGetVersionString()`, it doesn't need `hipObjInit()`. The new `get-version` example, installed with the others, shows how to use it. +- A project that adds hipObject with `add_subdirectory()` or + `FetchContent` can link the library as `hipobj::hipobj`, the name the + installed package gives it, as well as `hipobj`. ### Changed @@ -312,6 +315,9 @@ ROCm. The option defaults to what the compiler does without it: `ON` with GCC, and `OFF` with Clang, since Clang 18's shared runtimes ignore the run-time options that hipObject's programs set. +- Building the MinIO bridge (`HIPOBJ_MINIO_CLIENT=ON`) requires OpenSSL 3 + or later, which every supported platform has. Configuring fails with an + older OpenSSL. ### Removed @@ -441,6 +447,10 @@ can't find them otherwise. It now also lists the CMake options for sanitizers, clang-tidy, and include-what-you-use, and the environment variables that hipObject reads when it runs. +- When the tests were built with a GoogleTest that the build downloaded, + `cmake --install` installed GoogleTest's headers, libraries, and CMake + and pkg-config files in hipObject's prefix too. The packages weren't + affected. ### Known issues diff --git a/cmake/HIPOBJMinioCppDeps.cmake b/cmake/HIPOBJMinioCppDeps.cmake index bfb95e4e..97d810e6 100644 --- a/cmake/HIPOBJMinioCppDeps.cmake +++ b/cmake/HIPOBJMinioCppDeps.cmake @@ -11,7 +11,8 @@ include(FetchContent) -find_package(OpenSSL REQUIRED) +# The packages' dependencies name OpenSSL 3's libraries +find_package(OpenSSL 3 REQUIRED) if(NOT OpenSSL_FOUND) message(FATAL_ERROR "HIPOBJ_MINIO_CLIENT requires OpenSSL development headers. " diff --git a/cmake/HIPOBJUseGTest.cmake b/cmake/HIPOBJUseGTest.cmake index 324ab06b..1f3112c2 100644 --- a/cmake/HIPOBJUseGTest.cmake +++ b/cmake/HIPOBJUseGTest.cmake @@ -42,6 +42,10 @@ if(hipobj_fetch_gtest) CACHE BOOL "" FORCE) set(BUILD_GMOCK OFF CACHE BOOL "" FORCE) + # GoogleTest's install rules have no component, so without this, + # cmake --install would put GoogleTest in hipObject's prefix + set(INSTALL_GTEST OFF + CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) endif() @@ -50,7 +54,7 @@ function(hipobj_add_test TEST_NAME TEST_SOURCE) NAME ${TEST_NAME} SRCS ${TEST_SOURCE}) # Link the unit-test object build, not the shipped library, so tests - # can call internal functions, such as the ones that swap seams. + # can call the library's internal functions and classes. target_link_libraries(${TEST_NAME} PRIVATE hipobj_test_objects GTest::gtest diff --git a/integrations/minio-cpp/CMakeLists.txt b/integrations/minio-cpp/CMakeLists.txt index 3b41c5ad..2c252bc0 100644 --- a/integrations/minio-cpp/CMakeLists.txt +++ b/integrations/minio-cpp/CMakeLists.txt @@ -103,15 +103,9 @@ hipobj_add_runtime_library_dependency( hipobj_add_runtime_library_dependency( SONAMES libz.so.1 DEB zlib1g) -if(OPENSSL_VERSION VERSION_GREATER_EQUAL 3) - hipobj_add_runtime_library_dependency( - SONAMES libssl.so.3 libcrypto.so.3 - DEB libssl3t64) -else() - hipobj_add_runtime_library_dependency( - SONAMES libssl.so.1.1 libcrypto.so.1.1 - DEB libssl1.1) -endif() +hipobj_add_runtime_library_dependency( + SONAMES libssl.so.3 libcrypto.so.3 + DEB libssl3t64) # pugixml and curlpp are only shared libraries when they're the # system's. Otherwise they're built here as static libraries. if(pugixml_FOUND) diff --git a/integrations/minio-cpp/test/CMakeLists.txt b/integrations/minio-cpp/test/CMakeLists.txt index 59faa169..ee0fb867 100644 --- a/integrations/minio-cpp/test/CMakeLists.txt +++ b/integrations/minio-cpp/test/CMakeLists.txt @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: MIT -include(${PROJECT_SOURCE_DIR}/cmake/HIPOBJUseGTest.cmake) - # Don't link hipobj_minio here. hipobj_add_test() already links the # hipobj_test_objects copy of the library sources, and hipobj_minio # links hipobj, so a shared hipobj would put a second copy of every diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 428d47f0..974a405f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,6 +30,10 @@ hipobj_add_library( NAME hipobj SRCS ${HIPOBJ_SOURCES}) +# The name the installed package gives the library, so a project that +# adds hipObject with add_subdirectory() or FetchContent can use it too +add_library(hipobj::hipobj ALIAS hipobj) + # Only the functions marked HIPOBJ_API in include/hipobj.h are exported # from the shared library. VISIBILITY_INLINES_HIDDEN also hides inline # member functions. Neither hides C++ standard library template diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 332744c7..8a600fe5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,4 @@ if(NOT CMAKE_SKIP_INSTALL_RULES) add_subdirectory(install) endif() -if(BUILD_TESTING) - add_subdirectory(integration) -endif() +add_subdirectory(integration) diff --git a/test/common/test-common.h b/test/common/test-common.h deleted file mode 100644 index 0a38c504..00000000 --- a/test/common/test-common.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (c) Advanced Micro Devices, Inc. All rights reserved. - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include - -#include "hipobj.h" - -#define EXPECT_HIPOBJ_SUCCESS(expr) \ - do { \ - hipObjError_t e = (expr); \ - EXPECT_EQ(e.opError, hipObjSuccess); \ - } while (0) diff --git a/test/subproject/parent/CMakeLists.txt b/test/subproject/parent/CMakeLists.txt index 00e8a986..9b918a66 100644 --- a/test/subproject/parent/CMakeLists.txt +++ b/test/subproject/parent/CMakeLists.txt @@ -27,6 +27,11 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/parent-prefix") add_subdirectory(${HIPOBJ_SUBPROJECT_SOURCE_DIR} hipobject) +# A superproject links the library by the installed package's name +if(NOT TARGET hipobj::hipobj) + message(FATAL_ERROR "hipObject doesn't define the hipobj::hipobj target") +endif() + # hipObject's subproject test has to pass on CMAKE_PREFIX_PATH as # hipObject received it: with the prefix above, and without the ROCm # prefixes hipObject adds itself