[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905
[reactos.git] / dll / win32 / msxml3 / CMakeLists.txt
1
2 add_definitions(
3 -D__WINESRC__
4 -D__ROS_LONG64__
5 -D_WINE
6 -DLIBXML_STATIC
7 -DCOM_NO_WINDOWS_H)
8
9 if(MSVC)
10 add_compile_flags("/FIwine/typeof.h /FImsvc.h")
11 endif()
12
13 include_directories(
14 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
15 ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/libwin-iconv)
16
17 spec2def(msxml3.dll msxml3.spec ADD_IMPORTLIB NO_PRIVATE_WARNINGS)
18 add_typelib(msxml3_v1.idl)
19
20 list(APPEND SOURCE
21 attribute.c
22 bsc.c
23 cdata.c
24 comment.c
25 dispex.c
26 docfrag.c
27 doctype.c
28 domdoc.c
29 domimpl.c
30 element.c
31 entityref.c
32 httprequest.c
33 main.c
34 mxnamespace.c
35 mxwriter.c
36 node.c
37 nodelist.c
38 nodemap.c
39 parseerror.c
40 pi.c
41 saxreader.c
42 schema.c
43 selection.c
44 stylesheet.c
45 text.c
46 xdr.c
47 xmldoc.c
48 xmlelem.c
49 xmlparser.c
50 xmlview.c)
51
52 list(APPEND PCH_SKIP_SOURCE
53 factory.c
54 uuid.c
55 xslpattern.tab.c
56 xslpattern.yy.c)
57
58 # xslpattern.tab.c/xslpattern.yy.c have been generated with relative file paths...
59 set_source_files_properties(xslpattern.tab.c xslpattern.yy.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"")
60
61 list(APPEND msxml3_rc_deps
62 ${CMAKE_CURRENT_SOURCE_DIR}/msxml3.manifest
63 ${CMAKE_CURRENT_SOURCE_DIR}/msxml3_v1.rgs
64 ${CMAKE_CURRENT_SOURCE_DIR}/xmlparser.rgs
65 ${CMAKE_CURRENT_BINARY_DIR}/msxml3_v1.tlb)
66
67 set_source_files_properties(version.rc PROPERTIES OBJECT_DEPENDS "${msxml3_rc_deps}")
68
69 add_library(msxml3 MODULE
70 ${SOURCE}
71 ${PCH_SKIP_SOURCE}
72 version.rc
73 ${CMAKE_CURRENT_BINARY_DIR}/msxml3_stubs.c
74 ${CMAKE_CURRENT_BINARY_DIR}/msxml3.def)
75
76 add_idl_headers(xmlparser_idlheader xmlparser.idl)
77 set_module_type(msxml3 win32dll)
78 target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib)
79 add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll)
80 add_dependencies(msxml3 xmlparser_idlheader stdole2) # msxml3_v1.tlb needs stdole2.tlb
81 add_pch(msxml3 precomp.h "${PCH_SKIP_SOURCE}")
82 add_cd_file(TARGET msxml3 DESTINATION reactos/system32 FOR all)