NVHPC: warnings as error flag is "-Werror"

This commit is contained in:
Robert Maynard
2022-06-27 11:17:52 -04:00
committed by Brad King
parent cd324110d2
commit 35ec676ace
2 changed files with 2 additions and 2 deletions

View File

@@ -13,5 +13,5 @@ include(Compiler/PGI)
macro(__compiler_nvhpc lang)
# Logic specific to NVHPC.
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "--Werror all-warnings")
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror all-warnings")
endmacro()

View File

@@ -1,7 +1,7 @@
# add compile options to warning_options to ensure unused-function throws a warning
# if warning_options is NOT DEFINED, assume compiler doesn't support warning as error
macro(get_warning_options warning_options lang)
if (CMAKE_${lang}_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|XLClang|IBMClang|LCC|IntelLLVM)$")
if (CMAKE_${lang}_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|XLClang|IBMClang|LCC|IntelLLVM|NVHPC)$")
set(${warning_options} "-Wall")
elseif (CMAKE_${lang}_COMPILER_ID STREQUAL "MSVC"
OR (CMAKE_${lang}_COMPILER_ID STREQUAL "Intel" AND CMAKE_${lang}_SIMULATE_ID MATCHES "MSVC"))