Skip to content

Commit

Permalink
Split dir create into separate macro (#1141)
Browse files Browse the repository at this point in the history
* Split dir create into separate macro

* Correct VFD settings
  • Loading branch information
byrnHDF authored Oct 28, 2021
1 parent 07a3a1c commit fabdce5
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
1 change: 1 addition & 0 deletions c++/test/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
H5_CREATE_VFD_DIR()

##############################################################################
##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ endif ()
# Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake
# ----------------------------------------------------------------------
option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF)
if (H5FD_ENABLE_MIRROR_VFD)
if (HDF5_ENABLE_MIRROR_VFD)
if ( ${HDF_PREFIX}_HAVE_NETINET_IN_H AND
${HDF_PREFIX}_HAVE_NETDB_H AND
${HDF_PREFIX}_HAVE_ARPA_INET_H AND
Expand Down
3 changes: 3 additions & 0 deletions config/cmake/HDF5Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ macro (H5_SET_VFD_LIST)
if (H5_HAVE_WINDOWS)
set (VFD_LIST ${VFD_LIST} windows)
endif ()
endmacro ()

# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
macro (H5_CREATE_VFD_DIR)
foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
endforeach ()
Expand Down
42 changes: 22 additions & 20 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_thread_id_FORMAT thread_id)
endif ()

if (HDF5_BUILD_UTILS)
#-- Adding test for mirror_vfd
add_executable (mirror_vfd ${mirror_vfd_SOURCES})
if (HDF5_BUILD_UTILS) # requires mirror server
#-- Adding test for mirror_vfd
add_executable (mirror_vfd ${mirror_vfd_SOURCES})
target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (mirror_vfd STATIC)
Expand Down Expand Up @@ -752,24 +752,26 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_FORMAT use_append_chunk)
endif ()

set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk_mirror 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_mirror STATIC)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
else ()
TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)
if (HDF5_BUILD_UTILS) # requires mirror server
set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk_mirror 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_mirror STATIC)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
else ()
TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)

#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
endif ()
endif ()

set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
Expand Down
1 change: 1 addition & 0 deletions test/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
##############################################################################
##############################################################################
# included from CMakeTests.cmake
H5_CREATE_VFD_DIR()

# create more test folders for each VFD
foreach (vfdtest ${VFD_LIST})
Expand Down
1 change: 1 addition & 0 deletions testpar/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
H5_CREATE_VFD_DIR()

set (H5P_VFD_TESTS
t_pflush1
Expand Down
1 change: 1 addition & 0 deletions tools/test/h5dump/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
H5_CREATE_VFD_DIR()

# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
Expand Down
1 change: 1 addition & 0 deletions tools/test/h5repack/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
H5_CREATE_VFD_DIR()

##############################################################################
##############################################################################
Expand Down

0 comments on commit fabdce5

Please sign in to comment.