summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/cmake/H5pubconf.h.in15
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake54
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake2
-rw-r--r--configure.ac2
-rw-r--r--src/H5private.h2
5 files changed, 42 insertions, 33 deletions
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 5a94be3..04c0c9f 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -271,6 +271,9 @@
/* Define to 1 if you have the <pthread.h> header file. */
#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@
+/* Define to 1 if you have the <pwd.h> header file. */
+#cmakedefine H5_HAVE_PWD_H @H5_HAVE_PWD_H@
+
/* Define to 1 if you have the <quadmath.h> header file. */
#cmakedefine H5_HAVE_QUADMATH_H @H5_HAVE_QUADMATH_H@
@@ -631,6 +634,12 @@
PTHREAD_SCOPE_SYSTEM) call. */
#cmakedefine H5_SYSTEM_SCOPE_THREADS @H5_SYSTEM_SCOPE_THREADS@
+/* Define using v1.6 public API symbols by default */
+#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
+
+/* Define using v1.8 public API symbols by default */
+#cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@
+
/* Define using v1.10 public API symbols by default */
#cmakedefine H5_USE_110_API_DEFAULT @H5_USE_110_API_DEFAULT@
@@ -640,12 +649,6 @@
/* Define using v1.14 public API symbols by default */
#cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@
-/* Define using v1.6 public API symbols by default */
-#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
-
-/* Define using v1.8 public API symbols by default */
-#cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@
-
/* Define if the library will use file locking */
#cmakedefine H5_USE_FILE_LOCKING @H5_USE_FILE_LOCKING@
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index dc982c1..a121d0a 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -11,10 +11,10 @@
#
ENABLE_LANGUAGE (CXX)
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+set (CMAKE_CXX_STANDARD 11)
+set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
-set(CMAKE_CXX_EXTENSIONS OFF)
+set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
@@ -23,30 +23,34 @@ endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
-if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- set(_INTEL_WINDOWS 1)
-endif()
+if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (_INTEL_WINDOWS 1)
+endif ()
-if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
+if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- set(_CLANG_MSVC_WINDOWS 1)
+ set (_CLANG_MSVC_WINDOWS 1)
endif()
# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
-if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
-endif()
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
+ endif ()
+endif ()
-if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
- NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
- endif()
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
- endif()
-endif()
+if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED)
+ if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+ endif ()
+ else ()
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ endif ()
+ endif ()
+endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
@@ -301,7 +305,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@@ -309,7 +313,7 @@ if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
endif ()
endif ()
elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@@ -323,7 +327,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_PROFILING)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}")
endif ()
endif ()
@@ -333,7 +337,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_OPTIMIZATION)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}")
endif ()
endif ()
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 27c7045..1dd1440 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -115,7 +115,7 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
-
+CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_H)
CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
diff --git a/configure.ac b/configure.ac
index cbb192d..d955a9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1225,7 +1225,7 @@ AC_CHECK_LIB([dl], [dlopen])
##
## Unix
-AC_CHECK_HEADERS([dirent.h features.h unistd.h])
+AC_CHECK_HEADERS([dirent.h features.h unistd.h pwd.h])
AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/resource.h])
AC_CHECK_HEADERS([sys/stat.h sys/time.h sys/types.h])
diff --git a/src/H5private.h b/src/H5private.h
index 802dd90..7b18df0 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -44,7 +44,9 @@
#include <sys/time.h>
#endif
#ifdef H5_HAVE_UNISTD_H
+#ifdef H5_HAVE_PWD_H
#include <pwd.h>
+#endif
#include <unistd.h>
#include <sys/wait.h>
#endif