summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFCompilerFlags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake/HDFCompilerFlags.cmake')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 1dca910..a6bce98 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -47,6 +47,17 @@ if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGN
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000")
endif()
+if(CMAKE_C_COMPILER_ID STREQUAL "NVHPC" )
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=warn")
+ if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer")
+ if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s")
+ endif ()
+ else ()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -g")
+ endif ()
+endif()
+
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer")
@@ -106,7 +117,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
endif ()
#-----------------------------------------------------------------------------
-# HDF5 library compile options
+# HDF5 library compile options - to be made available to all targets
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------