diff --git a/cpp/cmake/thirdparty/get_gtest.cmake b/cpp/cmake/thirdparty/get_gtest.cmake index 10e6b026d9a..ec8cbd8c568 100644 --- a/cpp/cmake/thirdparty/get_gtest.cmake +++ b/cpp/cmake/thirdparty/get_gtest.cmake @@ -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 "$") + endif() endfunction() find_and_configure_gtest()