diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2022-04-11 10:50:22 -0700 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-11 14:16:33 -0400 |
commit | 476c6a89109d9737715c74bf3458628b665c4c8d (patch) | |
tree | a85d85b7a1ace54eca746470bb0314b835aaf9ad /Tests/RunCMake/PrecompileHeaders | |
parent | fcf1fcfd0c7eb360c26ff389649ee00380d30d15 (diff) | |
download | cmake-476c6a89109d9737715c74bf3458628b665c4c8d.tar.gz |
PCH: Fix Xcode non-pch language exclusion
Fix a regression caused by commit bbcdac4e5d (PCH: Fix all-language
precompile header support in Xcode, 2021-08-07, v3.22.0-rc1~140^2).
Fixes: #23138
Diffstat (limited to 'Tests/RunCMake/PrecompileHeaders')
-rw-r--r-- | Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake | 17 | ||||
-rw-r--r-- | Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake b/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake new file mode 100644 index 0000000000..dd582aca8c --- /dev/null +++ b/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.16) +project(PchIncludedAllLanguages C CXX) + +if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH) + add_definitions(-DHAVE_PCH_SUPPORT) +endif() + +add_executable(main + main.cpp + empty.c + pch-included.cpp +) + +target_precompile_headers(main PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/pch.h>) + +enable_testing() +add_test(NAME main COMMAND main) diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake index ca5b52e87c..29611aee9b 100644 --- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake +++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake @@ -29,4 +29,5 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") endif() run_test(PchReuseFromObjLib) run_test(PchIncludedAllLanguages) +run_test(PchIncludedOneLanguage) run_test(PchLibObjLibExe) |