mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
NVHPC: Use -Werror for COMPILE_OPTIONS_WARNING_AS_ERROR
The previously-used `-Werror all-warnings` is not supported by the NVHPC suite of compilers. This previously worked since `-Werror` was being used and `all-warnings` was being excluded. We thought this was the correct syntax due to incorrect documentation about `-Werror`, which stated the argument should be space-separated, while it should actually be separated with `=` or `,`. Issue: #24665
This commit is contained in:
committed by
Brad King
parent
827d5b75d4
commit
9d40f01442
@@ -1,4 +1,4 @@
|
||||
include(Compiler/PGI-Fortran)
|
||||
include(Compiler/NVHPC)
|
||||
__compiler_nvhpc(Fortran)
|
||||
set(CMAKE_Fortran_PREPROCESS_SOURCE_EXCLUDE_FLAGS_REGEX "(^| )-Werror +[a-z][a-z-]+( |$)")
|
||||
set(CMAKE_Fortran_PREPROCESS_SOURCE_EXCLUDE_FLAGS_REGEX "(^| )-Werror([=,][a-z][a-z-]+)?( |$)")
|
||||
|
||||
@@ -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")
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user