diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2023-04-13 14:37:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-25 15:16:26 (GMT) |
commit | 9d40f01442ba244573a010ed015c0e0ef9a8ab83 (patch) | |
tree | c51afc134682c9ccea8ec85f931be2a7fe6ac4a8 /Modules | |
parent | 827d5b75d47126205faba26cabc8856c6d9c3362 (diff) | |
download | CMake-9d40f01442ba244573a010ed015c0e0ef9a8ab83.zip CMake-9d40f01442ba244573a010ed015c0e0ef9a8ab83.tar.gz CMake-9d40f01442ba244573a010ed015c0e0ef9a8ab83.tar.bz2 |
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
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/NVHPC-Fortran.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/NVHPC.cmake | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/Compiler/NVHPC-Fortran.cmake b/Modules/Compiler/NVHPC-Fortran.cmake index 5c06457..879c140 100644 --- a/Modules/Compiler/NVHPC-Fortran.cmake +++ b/Modules/Compiler/NVHPC-Fortran.cmake @@ -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-]+)?( |$)") diff --git a/Modules/Compiler/NVHPC.cmake b/Modules/Compiler/NVHPC.cmake index 474ac80..0593456 100644 --- a/Modules/Compiler/NVHPC.cmake +++ b/Modules/Compiler/NVHPC.cmake @@ -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() |