diff options
author | Brad King <brad.king@kitware.com> | 2020-06-03 10:04:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-03 10:04:39 (GMT) |
commit | 37955f87d64c22c8119d387956aac8372cb3e38a (patch) | |
tree | b0796d7b4afb6d42c1513fea8c126edfcda1cf65 | |
parent | 73086daa576c2ffaed8fe0a00b3fbbcb085bec34 (diff) | |
parent | 10c88c433766cb9b4d3e6f95a96788559ff4136f (diff) | |
download | CMake-37955f87d64c22c8119d387956aac8372cb3e38a.zip CMake-37955f87d64c22c8119d387956aac8372cb3e38a.tar.gz CMake-37955f87d64c22c8119d387956aac8372cb3e38a.tar.bz2 |
Merge topic 'pch-no-Fortran' into release-3.17
10c88c4337 PCH: Do not enable GNU or Intel PCH settings for Fortran
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4843
-rw-r--r-- | Modules/Compiler/GNU.cmake | 12 | ||||
-rw-r--r-- | Modules/Compiler/Intel.cmake | 14 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 1c050a2..a68bb6c 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -110,10 +110,12 @@ macro(__compiler_gnu lang) endif() list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") - set(CMAKE_PCH_EXTENSION .gch) - if (NOT CMAKE_GENERATOR MATCHES "Xcode") - set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header") + if(NOT "x${lang}" STREQUAL "xFortran") + set(CMAKE_PCH_EXTENSION .gch) + if (NOT CMAKE_GENERATOR MATCHES "Xcode") + set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header") + endif() + set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -include <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -x ${__pch_header_${lang}} -include <PCH_HEADER>) endif() - set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -include <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -x ${__pch_header_${lang}} -include <PCH_HEADER>) endmacro() diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake index d895ed0..56a3078 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -33,11 +33,13 @@ else() endif() list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") - # Precompile Headers - set(CMAKE_PCH_EXTENSION .pchi) - set(CMAKE_LINK_PCH ON) - set(CMAKE_PCH_EPILOGUE "#pragma hdrstop") - set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>) + if(NOT "x${lang}" STREQUAL "xFortran") + # Precompile Headers + set(CMAKE_PCH_EXTENSION .pchi) + set(CMAKE_LINK_PCH ON) + set(CMAKE_PCH_EPILOGUE "#pragma hdrstop") + set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>) + endif() endmacro() endif() |