summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFCXXCompilerFlags.cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-10-18 19:44:42 (GMT)
committerGitHub <noreply@github.com>2023-10-18 19:44:42 (GMT)
commit65e1bd8ce90d286bd4ffc1575414d775ae86a319 (patch)
tree5aeb6bc35ab0b6e0d8fe29b56bd9141c4f69bca3 /config/cmake/HDFCXXCompilerFlags.cmake
parentfce7ce18697ecead37e75d3d05483ef995cf24dd (diff)
downloadhdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.zip
hdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.tar.gz
hdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.tar.bz2
Add NVidia compiler support and CI (#3686)
Diffstat (limited to 'config/cmake/HDFCXXCompilerFlags.cmake')
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake18
1 files changed, 17 insertions, 1 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index e8a55ba..13f712d 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -49,6 +49,22 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED)
endif ()
endif ()
+if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_LOADED)
+ if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
+ if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C11_STANDARD_COMPILE_OPTION}")
+ endif ()
+ endif ()
+ if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=warn")
+ if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
+ endif ()
+ else ()
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Mbounds -gopt -g")
+ endif ()
+endif ()
+
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer")
@@ -97,7 +113,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
endif ()
#-----------------------------------------------------------------------------
-# HDF5 library compile options
+# HDF5 library compile options - to be made available to all targets
#-----------------------------------------------------------------------------
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")