summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake
blob: 6c5e89d8607c78383ee6a48f71be05275e33a4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
enable_language(C)
enable_language(CXX)

if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH)
  add_definitions(-DHAVE_PCH_SUPPORT)
endif()

add_executable(main
  main.cpp
  empty.c
  pch-included.cpp
)

target_precompile_headers(main PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/pch.h>)

enable_testing()
add_test(NAME main COMMAND main)