summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2020-04-07 15:22:21 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2020-04-07 15:29:00 (GMT)
commit075e74e9b2e2ad761af44237aa78acc6ff3c3c24 (patch)
tree8511d081cc709a57790b4e92eb75571352ef40d3 /test/CMakeLists.txt
parentd97c00013dd5b13b618d08d9b6d6517176674a4e (diff)
parentb27a20f8c0e286ea7c2836605632ea2ee5522d03 (diff)
downloadhdf5-075e74e9b2e2ad761af44237aa78acc6ff3c3c24.zip
hdf5-075e74e9b2e2ad761af44237aa78acc6ff3c3c24.tar.gz
hdf5-075e74e9b2e2ad761af44237aa78acc6ff3c3c24.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~jake.smith/hdf5 into feature/vfd_splitter_mirror_a
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt38
1 files changed, 34 insertions, 4 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index cba1d3a..e3bfeb3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -32,6 +32,7 @@ if (NOT ONLY_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
+ target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_TEST_LIB_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
@@ -50,9 +51,8 @@ if (BUILD_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_definitions(${HDF5_TEST_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- )
+ target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
@@ -293,13 +293,14 @@ set (H5_TESTS
cache_logging
cork
swmr
- thread_id
+ thread_id # special link
vol
)
macro (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -316,6 +317,7 @@ set (H5_TESTS_MULTIPLE
testhdf5
cache_image
ttsafe
+ thread_id # special link
mirror_vfd
)
# Only build single source tests here
@@ -331,6 +333,7 @@ endforeach ()
######### Also special handling of link libs #############
#-- Adding test for chunk_info
add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c)
+target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (chunk_info STATIC)
@@ -343,6 +346,7 @@ set_target_properties (chunk_info PROPERTIES FOLDER test)
#-- Adding test for direct_chunk
add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
+target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (direct_chunk STATIC)
@@ -357,6 +361,7 @@ set_target_properties (direct_chunk PROPERTIES FOLDER test)
######### Special handling for multiple sources #############
#-- Adding test for testhdf5
add_executable (testhdf5 ${testhdf5_SOURCES})
+target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (testhdf5 STATIC)
@@ -369,6 +374,7 @@ set_target_properties (testhdf5 PROPERTIES FOLDER test)
#-- Adding test for cache_image
add_executable (cache_image ${cache_image_SOURCES})
+target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (cache_image STATIC)
@@ -381,6 +387,7 @@ set_target_properties (cache_image PROPERTIES FOLDER test)
#-- Adding test for ttsafe
add_executable (ttsafe ${ttsafe_SOURCES})
+target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (ttsafe STATIC)
@@ -396,6 +403,25 @@ 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_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+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)
+
#-- Adding test for mirror_vfd
add_executable (mirror_vfd ${mirror_vfd_SOURCES})
target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
@@ -476,6 +502,7 @@ endforeach ()
# This has to be copied to the test directory for execve() to find it
# and it can't be renamed (i.e., no <foo>-shared).
add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
+target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
@@ -511,6 +538,7 @@ endif ()
##############################################################################
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
+target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_chunk STATIC)
@@ -523,6 +551,7 @@ set_target_properties (use_append_chunk PROPERTIES FOLDER test)
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
+target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_mchunks STATIC)
@@ -535,6 +564,7 @@ set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
+target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)