summaryrefslogtreecommitdiffstats
path: root/config/cmake/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-03 16:11:27 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-03 16:11:27 (GMT)
commitbc1bed2c55981f1802f87f83054d375431a0088f (patch)
tree7f89238033aebca038770f6da775e13ec6902712 /config/cmake/ConfigureChecks.cmake
parent66ce984dee99b7b58ec4632fecad3b2b758d08d5 (diff)
downloadhdf5-bc1bed2c55981f1802f87f83054d375431a0088f.zip
hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.gz
hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.bz2
Squash merge of file locking fixes
Diffstat (limited to 'config/cmake/ConfigureChecks.cmake')
-rw-r--r--config/cmake/ConfigureChecks.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 2930969..ab121e9 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -61,6 +61,31 @@ if (HDF5_ENABLE_CODESTACK)
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK)
+# ----------------------------------------------------------------------
+# Check if they would like to use file locking by default
+#-----------------------------------------------------------------------------
+option (HDF5_USE_FILE_LOCKING "Use file locking by default (mainly for SWMR)" ON)
+if (HDF5_USE_FILE_LOCKING)
+ set (${HDF_PREFIX}_USE_FILE_LOCKING 1)
+endif ()
+
+# ----------------------------------------------------------------------
+# Check if they would like to ignore file locks when disabled on a file system
+#-----------------------------------------------------------------------------
+option (HDF5_IGNORE_DISABLED_FILE_LOCKS "Ignore file locks when disabled on file system" ON)
+if (HDF5_IGNORE_DISABLED_FILE_LOCKS)
+ set (${HDF_PREFIX}_IGNORE_DISABLED_FILE_LOCKS 1)
+endif ()
+
+# Set the libhdf5.settings file variable
+if (HDF5_IGNORE_DISABLED_FILE_LOCKS AND HDF5_USE_FILE_LOCKING)
+ set (HDF5_FILE_LOCKING_SETTING "best-effort")
+elseif (HDF5_IGNORE_DISABLED_FILE_LOCKS)
+ set (HDF5_FILE_LOCKING_SETTING "yes")
+else ()
+ set (HDF5_FILE_LOCKING_SETTING "no")
+endif ()
+
#-----------------------------------------------------------------------------
# Are we going to use HSIZE_T
#-----------------------------------------------------------------------------