diff options
author | Brad King <brad.king@kitware.com> | 2020-09-09 15:23:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-09 15:23:34 (GMT) |
commit | 6d77487eb74dd35b0965747263893a391440e429 (patch) | |
tree | ef238e154c433074bb1bbcff415810a09eba4535 /Modules | |
parent | e366977e62edc366e5b7ac38ed6c1c5cf729b428 (diff) | |
parent | 8d61294c3e127ceb6284fccb9cdc60287889fd1f (diff) | |
download | CMake-6d77487eb74dd35b0965747263893a391440e429.zip CMake-6d77487eb74dd35b0965747263893a391440e429.tar.gz CMake-6d77487eb74dd35b0965747263893a391440e429.tar.bz2 |
Merge topic 'ios-pch-x-lang-header'
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5188
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeOBJCXXInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Clang.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/Windows-Clang.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/Windows-Embarcadero.cmake | 7 |
4 files changed, 19 insertions, 4 deletions
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake index 71beb7f..4be9762 100644 --- a/Modules/CMakeOBJCXXInformation.cmake +++ b/Modules/CMakeOBJCXXInformation.cmake @@ -263,7 +263,7 @@ endif() # compile an Objective-C++ file into an object file if(NOT CMAKE_OBJCXX_COMPILE_OBJECT) set(CMAKE_OBJCXX_COMPILE_OBJECT - "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x objective-c++ -o <OBJECT> -c <SOURCE>") + "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") endif() if(NOT CMAKE_OBJCXX_LINK_EXECUTABLE) diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 52d5350..f7858d7 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -10,6 +10,11 @@ set(__COMPILER_CLANG 1) include(Compiler/CMakeCommonCompilerMacros) +set(__pch_header_C "c-header") +set(__pch_header_CXX "c++-header") +set(__pch_header_OBJC "objective-c-header") +set(__pch_header_OBJCXX "objective-c++-header") + if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC") @@ -102,7 +107,7 @@ else() set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") endif() set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}}) endmacro() endif() diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index c8c91de..0d74d30 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -8,6 +8,11 @@ if(__WINDOWS_CLANG) endif() set(__WINDOWS_CLANG 1) +set(__pch_header_C "c-header") +set(__pch_header_CXX "c++-header") +set(__pch_header_OBJC "objective-c-header") +set(__pch_header_OBJCXX "objective-c++-header") + macro(__windows_compiler_clang_gnu lang) set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") @@ -87,7 +92,7 @@ macro(__windows_compiler_clang_gnu lang) set(CMAKE_PCH_EXTENSION .pch) set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}}) unset(__ADDED_FLAGS) unset(__ADDED_FLAGS_DEBUG) diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake index 0c24739..59f3ca5 100644 --- a/Modules/Platform/Windows-Embarcadero.cmake +++ b/Modules/Platform/Windows-Embarcadero.cmake @@ -10,6 +10,11 @@ set(__WINDOWS_EMBARCADERO 1) set(BORLAND 1) +set(__pch_header_C "c-header") +set(__pch_header_CXX "c++-header") +set(__pch_header_OBJC "objective-c-header") +set(__pch_header_OBJCXX "objective-c++-header") + if("${CMAKE_${_lang}_COMPILER_VERSION}" VERSION_LESS 6.30) # Borland target type flags (bcc32 -h -t): set(_tW "-tW") # -tW GUI App (implies -U__CONSOLE__) @@ -123,7 +128,7 @@ macro(__embarcadero_language lang) if (EMBARCADERO) set(CMAKE_PCH_EXTENSION .pch) set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>) - set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>) + set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}}) endif() # Initial configuration flags. |