diff options
-rw-r--r-- | config/cmake/ConversionTests.c | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 321d879..c2748b2 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -9,7 +9,7 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -+ + #if defined(__has_attribute) #if __has_attribute(no_sanitize) #define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a1bab5c..5ba56e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1034,6 +1034,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) #----------------------------------------------------------------------------- set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) +add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${gen_SRCS}) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) target_include_directories(${HDF5_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" @@ -1056,12 +1057,14 @@ target_link_libraries (${HDF5_LIB_TARGET} set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) +add_dependencies (${HDF5_LIB_TARGET} gen_${HDF5_LIB_TARGET}) set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) + add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${shared_gen_SRCS}) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) target_include_directories(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" @@ -1086,6 +1089,7 @@ if (BUILD_SHARED_LIBS) 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") set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES FOLDER libraries) + add_dependencies (${HDF5_LIBSH_TARGET} gen_${HDF5_LIBSH_TARGET}) set (install_targets ${install_targets} ${HDF5_LIBSH_TARGET}) endif () |