summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-03-18 20:31:27 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:56 (GMT)
commit3e42250f0f413847db094d95aaa2e280b3bff5c8 (patch)
tree5b58933e95f147cc78c72918d16e2b4372cae9c9 /test/CMakeLists.txt
parentce9ef0ba127dfa17bf9bfe0d3722f4093c03a3e4 (diff)
downloadhdf5-3e42250f0f413847db094d95aaa2e280b3bff5c8.zip
hdf5-3e42250f0f413847db094d95aaa2e280b3bff5c8.tar.gz
hdf5-3e42250f0f413847db094d95aaa2e280b3bff5c8.tar.bz2
Fix threadsafe for new test
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index f423a1e..11c3d95 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -290,7 +290,7 @@ set (H5_TESTS
cache_logging
cork
swmr
- thread_id
+ thread_id # special link
vol
)
@@ -313,6 +313,7 @@ set (H5_TESTS_MULTIPLE
testhdf5
cache_image
ttsafe
+ thread_id # special link
)
# Only build single source tests here
foreach (h5_test ${H5_TESTS})
@@ -392,6 +393,24 @@ else ()
endif ()
set_target_properties (ttsafe PROPERTIES FOLDER test)
+######### Special handling for extra link lib of threads #############
+#-- Adding test for thread_id
+add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c)
+target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (thread_id STATIC)
+ target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET})
+ if (NOT WIN32)
+ target_link_libraries (thread_id
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ )
+ endif ()
+else ()
+ TARGET_C_PROPERTIES (thread_id SHARED)
+ target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
+endif ()
+set_target_properties (thread_id PROPERTIES FOLDER test)
+
##############################################################################
### A D D I T I O N A L T E S T S ###
##############################################################################