From 16c9b0210fac53e53ff9cde6f91e47ebe6119a46 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 17 Feb 2023 14:34:34 -0500 Subject: [PATCH] Propagate fmt requirement in conda envs When we are inside a conda env the linker will be set to `ld.bfd` which will try to resolve all undefined symbols at time. Since we could be using a shared library version of fmt we need it on the final link line of consumers --- nvbench/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nvbench/CMakeLists.txt b/nvbench/CMakeLists.txt index f86bd41..ba6418f 100644 --- a/nvbench/CMakeLists.txt +++ b/nvbench/CMakeLists.txt @@ -76,10 +76,25 @@ target_link_libraries(nvbench PUBLIC ${ctk_libraries} PRIVATE - fmt::fmt nvbench_json nvbench_git_revision ) + +# ################################################################################################## +# * conda environment ----------------------------------------------------------------------------- +rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH) +if(TARGET conda_env) + # When we are inside a conda env the linker will be set to + # `ld.bfd` which will try to resolve all undefined symbols at link time. + # + # Since we could be using a shared library version of fmt we need + # it on the final link line of consumers + target_link_libraries(nvbench PRIVATE $ + PUBLIC fmt::fmt) +else() + target_link_libraries(nvbench PRIVATE fmt::fmt) +endif() + target_compile_features(nvbench PUBLIC cuda_std_17 PRIVATE cxx_std_17) add_dependencies(nvbench.all nvbench)