Files
CMake/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
Brad King b204bae261 target_precompile_headers: Fix documented example using genex
When the path to a header file is specified using a generator
expression, evaluation of the genex must produce an absolute path.
Update our documented example and add a test covering the case.

Fixes: #20617
2020-04-27 14:12:41 -04:00

15 lines
457 B
CMake

cmake_minimum_required(VERSION 3.15)
project(PchMultilanguage C CXX)
add_executable(foobar
foo.c
main.cpp
)
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>>"
)