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 | 84f846d6fb8e58f823de6a3247bb8e4dc4336647 (patch) | |
tree | 0885873c0520b9dd4f8eeca5e319128fe32f1981 | |
parent | 73aaa5316e285f4293e597339919cb48c54fcb59 (diff) | |
parent | e76c11aa7c68abdfe60d1ad9c3df05ea06ef1755 (diff) | |
download | CMake-84f846d6fb8e58f823de6a3247bb8e4dc4336647.zip CMake-84f846d6fb8e58f823de6a3247bb8e4dc4336647.tar.gz CMake-84f846d6fb8e58f823de6a3247bb8e4dc4336647.tar.bz2 |
Merge topic 'pch-no-Fortran'
e76c11aa7c Merge branch 'backport-3.17-pch-no-Fortran' into pch-no-Fortran
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 | 14 | ||||
-rw-r--r-- | Modules/Compiler/Intel.cmake | 16 |
2 files changed, 17 insertions, 13 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index df6d6b8..668a6a9 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -111,11 +111,13 @@ 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_INVALID_PCH -Winvalid-pch) + set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -include <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -x ${__pch_header_${lang}} -include <PCH_HEADER>) endif() - set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch) - set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -include <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -x ${__pch_header_${lang}} -include <PCH_HEADER>) endmacro() diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake index 63a20af..9a760c8 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -33,12 +33,14 @@ 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_INVALID_PCH -Winvalid-pch) - set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_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_INVALID_PCH -Winvalid-pch) + set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>) + endif() endmacro() endif() |