From 4af20bb7940bbbfb624a231b6394a996f5dd755a Mon Sep 17 00:00:00 2001 From: Simon Maertens Date: Wed, 13 Mar 2024 15:33:49 +0100 Subject: NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms The Ninja generator uses separate preprocessing and compilation steps. Do not pass `-fpp` when compiling an already-preprocessed source. Issue: #25900 --- Modules/Platform/Apple-NAG-Fortran.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Modules/Platform/Apple-NAG-Fortran.cmake b/Modules/Platform/Apple-NAG-Fortran.cmake index 0836e1c..828d7ab 100644 --- a/Modules/Platform/Apple-NAG-Fortran.cmake +++ b/Modules/Platform/Apple-NAG-Fortran.cmake @@ -3,9 +3,13 @@ set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood. -# Need -fpp explicitly on case-insensitive filesystem. -set(CMAKE_Fortran_COMPILE_OBJECT - " -fpp -o -c ") +# FIXME(#25900): We need -fpp explicitly on case-insensitive filesystems, +# but this does not work with the Ninja generator's separate preprocessing +# and compilation steps. +if(NOT CMAKE_GENERATOR MATCHES "^Ninja") + set(CMAKE_Fortran_COMPILE_OBJECT + " -fpp -o -c ") +endif() set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version -Wl,") set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version -Wl,") -- cgit v0.12