summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2021-08-07 15:07:55 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2021-09-13 15:12:11 (GMT)
commitbbcdac4e5d53de12013c6af6395b28e4816f7823 (patch)
tree1d18f8ca2efc885fac477e2ce832bb161fdddd1d /Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake
parentcc94429c61fcdff73ff78430692ff12ed1fff29b (diff)
downloadCMake-bbcdac4e5d53de12013c6af6395b28e4816f7823.zip
CMake-bbcdac4e5d53de12013c6af6395b28e4816f7823.tar.gz
CMake-bbcdac4e5d53de12013c6af6395b28e4816f7823.tar.bz2
PCH: Fix all-language precompile header support in Xcode
Fixes: #22384
Diffstat (limited to 'Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake b/Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake
new file mode 100644
index 0000000..a455410
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchIncludedAllLanguages C CXX)
+
+if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH)
+ add_definitions(-DHAVE_PCH_SUPPORT)
+endif()
+
+add_executable(main
+ main.cpp
+ pch-included.c
+ pch-included.cpp
+)
+target_precompile_headers(main PRIVATE pch.h)
+
+enable_testing()
+add_test(NAME main COMMAND main)