mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
729d997f10
Add the ability to share precompiled headers artifacts between targets. Fixes: #19659
19 lines
401 B
CMake
19 lines
401 B
CMake
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)
|