mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Fix logic from commit 9df1f33c9a (VisualStudio: move PCH rules to
projects when possible., 2020-10-15, v3.20.0-rc1~638^2) to explicitly
disable PCH on sources that should not use the target-wide PCH rules.
Fixes: #21827
16 lines
308 B
CMake
16 lines
308 B
CMake
enable_language(C)
|
|
enable_language(CXX)
|
|
|
|
add_executable(main
|
|
no_pch.c
|
|
use_pch.cxx
|
|
)
|
|
|
|
target_include_directories(main PUBLIC include)
|
|
target_precompile_headers(main PRIVATE
|
|
"$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/include/cxx_pch.h>"
|
|
)
|
|
|
|
enable_testing()
|
|
add_test(NAME main COMMAND main)
|