diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2020-03-18 18:21:08 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2020-03-26 13:24:46 (GMT) |
commit | 2ce08e54891054aeba3f273f9970a7fe8fa8b66c (patch) | |
tree | dddfaec9accd7f9d5c0d5cfa1a036cd35e162b4f /Modules/Compiler | |
parent | 863b0fa2aca3ece98d177f2dbafcad56f7037c8a (diff) | |
download | CMake-2ce08e54891054aeba3f273f9970a7fe8fa8b66c.zip CMake-2ce08e54891054aeba3f273f9970a7fe8fa8b66c.tar.gz CMake-2ce08e54891054aeba3f273f9970a7fe8fa8b66c.tar.bz2 |
PCH: add an option to disable `-Winvalid-pch`
Fixes: #20295
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/GNU.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/Intel.cmake | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 1c050a2..3357a86 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -114,6 +114,7 @@ macro(__compiler_gnu lang) 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>) + 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 d895ed0..63a20af 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -37,7 +37,8 @@ else() 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>) + 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>) endmacro() endif() |