summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake17
1 files changed, 17 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)