From 995a777a8662660291a26fe19dbb4efd7e3f58e3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 2 Aug 2024 08:41:46 -0500 Subject: [PATCH] Correct the properties for using THREADS library --- src/CMakeLists.txt | 3 +-- test/CMakeLists.txt | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3fb87c63862..4a13c5a47ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1135,8 +1135,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} - "$<$,$>:Threads::Threads>" - PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" + PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" "$<$,$>:Threads::Threads>" ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 90df410c42e..5a7e483210a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -573,12 +573,9 @@ target_include_directories (ttsafe PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_ if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe STATIC) target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET}) - if (NOT WIN32) - target_link_libraries (ttsafe PRIVATE "$<$:Threads::Threads>") - endif () else () TARGET_C_PROPERTIES (ttsafe SHARED) - target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$:Threads::Threads>") + target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (ttsafe PROPERTIES FOLDER test)