summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-16 14:54:11 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-16 14:54:11 (GMT)
commit84e14a52ff694b5fc28511bae68dbb1e39dde246 (patch)
tree9a957a30888df60dcec81b8693b6a511c1d4788d /Tests/RunCMake
parentc2a7729177fa62a4a8eb3e2f7385f3f517c42f91 (diff)
parentac75886525c647ef7081dc11f6c0c128463b7ecd (diff)
downloadCMake-84e14a52ff694b5fc28511bae68dbb1e39dde246.zip
CMake-84e14a52ff694b5fc28511bae68dbb1e39dde246.tar.gz
CMake-84e14a52ff694b5fc28511bae68dbb1e39dde246.tar.bz2
Merge branch 'doc-pch-compile-language' into release-3.16
Merge-request: !3925
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake14
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake5
2 files changed, 18 insertions, 1 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
index 44fe2da..e0b753a 100644
--- a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
@@ -15,3 +15,17 @@ if (NOT EXISTS ${foobar_pch_hxx_header})
set(RunCMake_TEST_FAILED "Generated foobar C++ pch header ${foobar_pch_hxx_header} does not exist")
return()
endif()
+
+file(STRINGS ${foobar_pch_h_header} foobar_pch_h_header_strings)
+
+if (NOT foobar_pch_h_header_strings MATCHES ";#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>(;|$)")
+ 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 7a837da..cdc42b2 100644
--- a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
@@ -6,4 +6,7 @@ add_executable(foobar
main.cpp
)
target_include_directories(foobar PUBLIC include)
-target_precompile_headers(foobar PRIVATE "<stddef.h>")
+target_precompile_headers(foobar PRIVATE
+ "$<$<COMPILE_LANGUAGE:C>:<stddef.h$<ANGLE-R>>"
+ "$<$<COMPILE_LANGUAGE:CXX>:<cstddef$<ANGLE-R>>"
+ )