summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-19 14:35:13 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-02-19 14:35:18 (GMT)
commit020d8c85e20a28c46951ba82410cdff05e857689 (patch)
tree1e2851a3bffd1c205dfaa45e81ec18217e67a8a2
parentc8ff06a1f8a31782ca314072fa0f98f953f97305 (diff)
parentc9244f369a149be83fe0807d857d3dde3f7f54aa (diff)
downloadCMake-020d8c85e20a28c46951ba82410cdff05e857689.zip
CMake-020d8c85e20a28c46951ba82410cdff05e857689.tar.gz
CMake-020d8c85e20a28c46951ba82410cdff05e857689.tar.bz2
Merge topic 'intel-fortran-preprocess' into release-3.20
c9244f369a IntelLLVM: Make explicit Fortran preprocessing under Ninja more robust 056d4bf528 Merge branch 'backport-intel-fortran-preprocess' af074c266e Intel: Make explicit Fortran preprocessing under Ninja more robust Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5826
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake12
-rw-r--r--Modules/Compiler/IntelLLVM-Fortran.cmake12
2 files changed, 20 insertions, 4 deletions
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 71f25f4..9fb6d46 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -13,7 +13,15 @@ set(CMAKE_Fortran_COMPILE_WITH_DEFINES 1)
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-set(CMAKE_Fortran_PREPROCESS_SOURCE
- "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+if(CMAKE_HOST_WIN32)
+ # MSVC-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -Fi<PREPROCESSED_SOURCE>")
+else()
+ # GNU-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -o <PREPROCESSED_SOURCE>")
+endif()
+
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp")
diff --git a/Modules/Compiler/IntelLLVM-Fortran.cmake b/Modules/Compiler/IntelLLVM-Fortran.cmake
index 3dfa099..710803f 100644
--- a/Modules/Compiler/IntelLLVM-Fortran.cmake
+++ b/Modules/Compiler/IntelLLVM-Fortran.cmake
@@ -13,7 +13,15 @@ set(CMAKE_Fortran_COMPILE_WITH_DEFINES 1)
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-set(CMAKE_Fortran_PREPROCESS_SOURCE
- "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+if(CMAKE_HOST_WIN32)
+ # MSVC-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -Fi<PREPROCESSED_SOURCE>")
+else()
+ # GNU-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -o <PREPROCESSED_SOURCE>")
+endif()
+
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp")