summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-04 21:36:52 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-04 21:36:52 (GMT)
commit30c7264c2ca0f169b099b6ebbf13c5bd71652ebc (patch)
tree1a92edfa20e5e6dfe467b002227220c7f9d61cfd /fortran
parent6b71d6dc9453e8f94ac82732496ee59ca6495587 (diff)
downloadhdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.zip
hdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.tar.gz
hdf5-30c7264c2ca0f169b099b6ebbf13c5bd71652ebc.tar.bz2
CMake and script changes for clang-format
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/CMakeLists.txt23
-rw-r--r--fortran/test/CMakeLists.txt15
2 files changed, 36 insertions, 2 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index b1add54..481a4d2 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -180,6 +180,29 @@ if (BUILD_SHARED_LIBS)
endif ()
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT ONLY_SHARED_LIBS)
+ clang_format (HDF5_F90_C_SRC_FORMAT
+ ${HDF5_F90_C_LIB_TARGET}
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
+ )
+ else ()
+ clang_format (HDF5_F90_C_SRC_FORMAT
+ ${HDF5_F90_C_LIBSH_TARGET}
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
+ )
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Fortran Modules
#-----------------------------------------------------------------------------
set (f90_F_GEN_SOURCES
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index ff7001b..dadf644 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -42,7 +42,7 @@ endif ()
# Add Test Lib
#-----------------------------------------------------------------------------
if (NOT BUILD_SHARED_LIBS)
- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c)
+ add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c t.h)
set_source_files_properties (t.c PROPERTIES LANGUAGE C)
target_include_directories (${HDF5_F90_C_TEST_LIB_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -60,7 +60,7 @@ if (NOT BUILD_SHARED_LIBS)
LINKER_LANGUAGE C
)
else ()
- add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c)
+ add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c t.h)
target_include_directories (${HDF5_F90_C_TEST_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -79,6 +79,17 @@ else ()
)
endif ()
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ if (NOT BUILD_SHARED_LIBS)
+ clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIB_TARGET})
+ else ()
+ clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIBSH_TARGET})
+ endif ()
+endif ()
+
if (NOT BUILD_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90