summaryrefslogtreecommitdiff
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-04-04 14:08:11 -0400
committerBrad King <brad.king@kitware.com>2023-04-04 14:53:26 -0400
commit6b58cdd4cf59d6d5c66c66daf81112f911e84238 (patch)
tree3621d2ca3a84e3e731eadab43b9821d72b81b6bf /Modules/Compiler
parent87b97464f7e0e0fa46629fc46f1ddfeec123c773 (diff)
downloadcmake-6b58cdd4cf59d6d5c66c66daf81112f911e84238.tar.gz
Ninja: Exclude NVHPC -Werror flags during Fortran preprocessing
The Ninja generator preprocesses Fortran separately in order to scan for module dependencies. NVHPC's `nvfortran` does not support its `-Werror` flag while preprocessing with `-E`, so filter it out. Fixes: #24665
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/NVHPC-Fortran.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Compiler/NVHPC-Fortran.cmake b/Modules/Compiler/NVHPC-Fortran.cmake
index 59755b3a71..5c0645737d 100644
--- a/Modules/Compiler/NVHPC-Fortran.cmake
+++ b/Modules/Compiler/NVHPC-Fortran.cmake
@@ -1,3 +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-]+( |$)")