Skip to content

Commit

Permalink
Hide all gtest symbols in cudftestutil (#16546)
Browse files Browse the repository at this point in the history
By hiding the gtest symbols in cudftestutil it allows consumers of the library to build with a differing version of gtest without issue.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Marcus D. Hanwell (https://github.com/cryos)
  - Bradley Dice (https://github.com/bdice)

URL: #16546
  • Loading branch information
robertmaynard authored Aug 15, 2024
1 parent 2bcb7ec commit ac42bc8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpp/cmake/thirdparty/get_gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@
function(find_and_configure_gtest)
include(${rapids-cmake-dir}/cpm/gtest.cmake)

# Mark all the non explicit googletest symbols as hidden. This ensures that libcudftestutil can be
# used by consumers with a different shared gtest.
set(gtest_hide_internal_symbols ON)

# Find or install GoogleTest
rapids_cpm_gtest(BUILD_STATIC)

# Mark all the explicit googletest symbols as hidden. This ensures that libcudftestutil can be
# used by consumers with a different shared gtest.
if(TARGET gtest)
target_compile_definitions(gtest PUBLIC "$<BUILD_LOCAL_INTERFACE:GTEST_API_=>")
endif()
endfunction()

find_and_configure_gtest()

0 comments on commit ac42bc8

Please sign in to comment.