3 if(CMAKE_C_COMPILE_OPTIONS_USE_PCH)
4 add_definitions(-DHAVE_PCH_SUPPORT)
7 # Add this before the target from which we will reuse the PCH
8 # to test that generators can handle reversed ordering.
10 target_include_directories(foo PUBLIC include)
12 add_library(empty empty.c)
13 target_precompile_headers(empty PRIVATE
17 target_include_directories(empty PUBLIC include)
19 target_precompile_headers(foo REUSE_FROM empty)
21 # should not cause problems if configured multiple times
22 target_precompile_headers(foo REUSE_FROM empty)
24 add_executable(foobar foobar.c)
25 target_link_libraries(foobar foo )
26 set_target_properties(foobar PROPERTIES PRECOMPILE_HEADERS_REUSE_FROM foo)
29 add_test(NAME foobar COMMAND foobar)