diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2019-06-19 21:43:23 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2019-06-19 21:43:23 (GMT) |
commit | 246b40f8f815308b929e55279e30887ffec7b8e4 (patch) | |
tree | c4e1c262f112a498aeb54090d90e39f97ffca026 /c++ | |
parent | 82f656aed0beed3b40e682f51e979e8e20ccde74 (diff) | |
parent | ca1ee7fae118c8d4137b1b5efe57660d2e0ff9b1 (diff) | |
download | hdf5-246b40f8f815308b929e55279e30887ffec7b8e4.zip hdf5-246b40f8f815308b929e55279e30887ffec7b8e4.tar.gz hdf5-246b40f8f815308b929e55279e30887ffec7b8e4.tar.bz2 |
Merge pull request #6 in ~VCHOI/my_third_fork from develop to bugfix/new_shutdown_fsm
* commit 'ca1ee7fae118c8d4137b1b5efe57660d2e0ff9b1': (64 commits)
Fix memory leak in objcopy test after H5Aread of vlen data
HDFFV-10616 add h5fc script
Fixed a problem in the ohdr test where hard-coded strings passed to H5Awrite() triggered -fsanitize failures.
Yanked qsort assert
Switched to HGOTO_DONE() in the links code.
Updated the HDqsort() macro to ensure we don't pass NULL buffers to qsort(3) in the future.
Fixed a bug in the links code where iterating over an empty group would pass a NULL pointer to qsort(3), which is undefined behavior.
Reset the other convenience pointer because why no
Fixed a memory bug where a pointer is used after it's been freed.
fixed pass_through vol
HDFFV-10805 Add option to only build shared targets
Fixed a warning in H5CX.c concerning incorrect use of freeing VOL connector info.
Add H5S_SEL_ITER_SHARE_WITH_DATASPACE selection iterator creation flag, to share dataspace's selection with iterator (and with caution about not modifying or closing the dataspace while the iterator is open).
Added a warning summary script for gcc to bin
Fix misc. typos, etc. from code review
Fixed problem with H5Fdelete "test" and split VFD.
New hyperslab selection routines and new public selection iterator routines.
Added the creation and use of an attribute access property list to testhdf5.
Update MANIFEST for move of h5cc.in and h5redeploy.in to bin directory.
Added missing DELETE enum value.
...
Diffstat (limited to 'c++')
-rw-r--r-- | c++/Makefile.am | 8 | ||||
-rw-r--r-- | c++/examples/CMakeLists.txt | 22 | ||||
-rw-r--r-- | c++/src/CMakeLists.txt | 40 | ||||
-rw-r--r-- | c++/test/CMakeLists.txt | 15 |
4 files changed, 54 insertions, 31 deletions
diff --git a/c++/Makefile.am b/c++/Makefile.am index 3713901..319ce6e 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -18,9 +18,15 @@ include $(top_srcdir)/config/commence.am +if BUILD_TESTS_CONDITIONAL + TEST_DIR = test +else + TEST_DIR= +endif + ## Only recurse into subdirectories if C++ interface is enabled. if BUILD_CXX_CONDITIONAL - SUBDIRS=src test + SUBDIRS=src $(TEST_DIR) # Test with just the native connector, with a single pass-through connector # and with a doubly-stacked pass-through. diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index d3a18f2..2088019 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -34,17 +34,27 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories(cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) + target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) endforeach () diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 945b352..8e7f8be 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -84,24 +84,26 @@ set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h ) -add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) -target_include_directories(${HDF5_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" - INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" -) -target_compile_definitions(${HDF5_CPP_LIB_TARGET} - PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings -) -TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC) -target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") -H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0) -set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) -set (install_targets ${HDF5_CPP_LIB_TARGET}) +if (NOT ONLY_SHARED_LIBS) + add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) + target_include_directories (${HDF5_CPP_LIB_TARGET} + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + ) + target_compile_definitions(${HDF5_CPP_LIB_TARGET} + PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings + ) + TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC) + target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") + H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC 0) + set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) + set (install_targets ${HDF5_CPP_LIB_TARGET}) +endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) - target_include_directories(${HDF5_CPP_LIBSH_TARGET} + target_include_directories (${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) @@ -136,7 +138,9 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) endif () - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) + if (NOT ONLY_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) + endif () install ( TARGETS @@ -163,7 +167,9 @@ set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") set (_PKG_CONFIG_LIBS_PRIVATE) -set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +if (NOT ONLY_SHARED_LIBS) + set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_CPP_LIB_CORENAME}") +endif () if (BUILD_SHARED_LIBS) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}") endif () diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 8e2d685..95ca9b1 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -38,16 +38,17 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) -target_include_directories(cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") target_compile_definitions(cpp_testhdf5 PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings ) -TARGET_C_PROPERTIES (cpp_testhdf5 STATIC) -target_link_libraries (cpp_testhdf5 PRIVATE - ${HDF5_CPP_LIB_TARGET} - ${HDF5_LIB_TARGET} - ${HDF5_TEST_LIB_TARGET} -) +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (cpp_testhdf5 STATIC) + target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (cpp_testhdf5 SHARED) + target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) +endif () set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) include (CMakeTests.cmake) |