summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-08-30 14:21:19 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-09-17 09:58:38 (GMT)
commit729d997f1073c7a177da5b46b073a08b95adfa74 (patch)
tree0b419aebe0dcb8a30686861954c4e8515d448a1d /Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
parent1ac4e0ef1b29affc9e4f2cd86c4fc8c2252f2ab2 (diff)
downloadCMake-729d997f1073c7a177da5b46b073a08b95adfa74.zip
CMake-729d997f1073c7a177da5b46b073a08b95adfa74.tar.gz
CMake-729d997f1073c7a177da5b46b073a08b95adfa74.tar.bz2
Precompile Headers: Add REUSE_FROM signature
Add the ability to share precompiled headers artifacts between targets. Fixes: #19659
Diffstat (limited to 'Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
new file mode 100644
index 0000000..fff74dc
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchReuseFromSubdir C)
+
+add_library(empty empty.c)
+target_precompile_headers(empty PUBLIC
+ <stdio.h>
+ <string.h>
+)
+target_include_directories(empty PUBLIC include)
+
+add_library(foo foo.c)
+target_include_directories(foo PUBLIC include)
+target_precompile_headers(foo REUSE_FROM empty)
+
+subdirs(subdir)
+
+enable_testing()
+add_test(NAME foobar COMMAND foobar)