1
2include_directories(
3    include
4    ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/libwin-iconv
5    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib)
6
7add_definitions(
8    -D__MINGW32__
9    -DLIBXML_STATIC
10    -D_REENTRANT
11    -DHAVE_WIN32_THREADS
12    -D_MBCS
13    -D_WINDOWS
14    -DWIN32
15    -DHAVE_CONFIG_H
16    -DICONV_CONST=const
17    -D_DLL -D__USE_CRTIMP)
18
19list(APPEND SOURCE
20    buf.c
21    c14n.c
22    catalog.c
23    chvalid.c
24    debugXML.c
25    dict.c
26    encoding.c
27    entities.c
28    error.c
29    globals.c
30    hash.c
31    HTMLparser.c
32    HTMLtree.c
33    legacy.c
34    list.c
35    nanoftp.c
36    nanohttp.c
37    parser.c
38    parserInternals.c
39    pattern.c
40    relaxng.c
41    SAX.c
42    SAX2.c
43    threads.c
44    tree.c
45    uri.c
46    valid.c
47    xinclude.c
48    xlink.c
49    xmlIO.c
50    xmlmemory.c
51    xmlreader.c
52    xmlregexp.c
53    xmlmodule.c
54    xmlsave.c
55    xmlschemas.c
56    xmlschemastypes.c
57    xmlunicode.c
58    xmlwriter.c
59    xpath.c
60    xpointer.c
61    xmlstring.c
62    libxml.h)
63
64add_library(libxml2 ${SOURCE})
65
66if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
67    # Unreferenced local variable
68    remove_target_compile_option(libxml2 "/we4101")
69    target_compile_options(libxml2 PRIVATE "/wd4101")
70    # Local variable initialized but not referenced
71    remove_target_compile_option(libxml2 "/we4189")
72else()
73    target_compile_options(libxml2 PRIVATE "-w")
74endif()
75
76target_link_libraries(libxml2 oldnames)
77add_pch(libxml2 libxml.h SOURCE)
78add_dependencies(libxml2 psdk)
79