summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PrecompileHeaders
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-28 11:08:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-04-28 11:09:01 (GMT)
commit25cbd22afbe39539cc75bf6f9fad6268025bd18f (patch)
tree6cf21f626c5065010a14874834d020cc8025b72f /Tests/RunCMake/PrecompileHeaders
parentee1689f9616d54cf2cd93618521f7a6654bf0931 (diff)
parentb204bae2613494a5ce779a4a7f9b000d84b8ab03 (diff)
downloadCMake-25cbd22afbe39539cc75bf6f9fad6268025bd18f.zip
CMake-25cbd22afbe39539cc75bf6f9fad6268025bd18f.tar.gz
CMake-25cbd22afbe39539cc75bf6f9fad6268025bd18f.tar.bz2
Merge topic 'pch-genex-absolute'
b204bae261 target_precompile_headers: Fix documented example using genex Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Cristian Adam <cristian.adam@gmail.com> Merge-request: !4678
Diffstat (limited to 'Tests/RunCMake/PrecompileHeaders')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/foo_C.h1
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/foo_CXX.h1
4 files changed, 6 insertions, 2 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
index 1696037..3119341 100644
--- a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
@@ -17,14 +17,14 @@ endif()
file(STRINGS ${foobar_pch_h_header} foobar_pch_h_header_strings)
-if (NOT foobar_pch_h_header_strings MATCHES ";#include <stddef.h>(;|$)")
+if (NOT foobar_pch_h_header_strings MATCHES ";#include \"[^\"]*PrecompileHeaders/include/foo_C.h\";#include <stddef.h>(;|$)")
set(RunCMake_TEST_FAILED "Generated foo pch header\n ${foobar_pch_h_header}\nhas bad content:\n ${foobar_pch_h_header_strings}")
return()
endif()
file(STRINGS ${foobar_pch_hxx_header} foobar_pch_hxx_header_strings)
-if (NOT foobar_pch_hxx_header_strings MATCHES ";#include <cstddef>(;|$)")
+if (NOT foobar_pch_hxx_header_strings MATCHES ";#include \"[^\"]*PrecompileHeaders/include/foo_CXX.h\";#include <cstddef>(;|$)")
set(RunCMake_TEST_FAILED "Generated foo pch header\n ${foobar_pch_hxx_header}\nhas bad content:\n ${foobar_pch_hxx_header_strings}")
return()
endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
index cdc42b2..bb18a64 100644
--- a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
@@ -7,6 +7,8 @@ add_executable(foobar
)
target_include_directories(foobar PUBLIC include)
target_precompile_headers(foobar PRIVATE
+ "$<$<COMPILE_LANGUAGE:C>:${CMAKE_CURRENT_SOURCE_DIR}/include/foo_C.h>"
+ "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/include/foo_CXX.h>"
"$<$<COMPILE_LANGUAGE:C>:<stddef.h$<ANGLE-R>>"
"$<$<COMPILE_LANGUAGE:CXX>:<cstddef$<ANGLE-R>>"
)
diff --git a/Tests/RunCMake/PrecompileHeaders/include/foo_C.h b/Tests/RunCMake/PrecompileHeaders/include/foo_C.h
new file mode 100644
index 0000000..f4de601
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/foo_C.h
@@ -0,0 +1 @@
+#include "foo.h"
diff --git a/Tests/RunCMake/PrecompileHeaders/include/foo_CXX.h b/Tests/RunCMake/PrecompileHeaders/include/foo_CXX.h
new file mode 100644
index 0000000..f4de601
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/foo_CXX.h
@@ -0,0 +1 @@
+#include "foo.h"