[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905
[reactos.git] / dll / ntdll / CMakeLists.txt
index 5ea6ca5..6ad60fd 100644 (file)
@@ -23,8 +23,7 @@ list(APPEND SOURCE
     rtl/libsupp.c
     rtl/uilist.c
     rtl/version.c
-    etw/trace.c
-    include/ntdll.h)
+    etw/trace.c)
 
 if(ARCH STREQUAL "i386")
     list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
@@ -38,11 +37,14 @@ endif()
 
 add_asm_files(ntdll_asm ${ASM_SOURCE})
 
+list(APPEND PCH_SKIP_SOURCE
+    ${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c)
+
 add_library(ntdll MODULE
     ${SOURCE}
     ${ntdll_asm}
+    ${PCH_SKIP_SOURCE}
     def/ntdll.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c
     ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
 
 set_module_type(ntdll win32dll ENTRYPOINT 0)
@@ -56,6 +58,6 @@ if(MSVC)
 endif()
 
 target_link_libraries(ntdll rtl ntdllsys libcntpr uuid ${PSEH_LIB})
-add_pch(ntdll include/ntdll.h SOURCE)
+add_pch(ntdll include/ntdll.h "${PCH_SKIP_SOURCE}")
 add_dependencies(ntdll ntstatus asm)
 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)