1
2add_definitions(
3    -D__WINESRC__
4    -D__ROS_LONG64__
5    -DENTRY_PREFIX=WIC_
6    -DPROXY_DELEGATION
7    -DWINE_REGISTER_DLL)
8
9remove_definitions(-D_WIN32_WINNT=0x502)
10add_definitions(-D_WIN32_WINNT=0x600)
11
12include_directories(
13    BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
14    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libjpeg
15    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
16    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libpng
17    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libtiff)
18
19spec2def(windowscodecs.dll windowscodecs.spec ADD_IMPORTLIB)
20add_rpcproxy_files(windowscodecs_wincodec.idl)
21
22list(APPEND SOURCE
23    bmpdecode.c
24    bmpencode.c
25    clipper.c
26    clsfactory.c
27    colorcontext.c
28    colortransform.c
29    converter.c
30    fliprotate.c
31    gifformat.c
32    icnsformat.c
33    icoformat.c
34    imgfactory.c
35    info.c
36    jpegformat.c
37    main.c
38    metadatahandler.c
39    metadataquery.c
40    palette.c
41    pngformat.c
42    propertybag.c
43    proxy.c
44    regsvr.c
45    scaler.c
46    stream.c
47    tgaformat.c
48    tiffformat.c
49    ungif.c)
50
51if(MSVC)
52    if(ARCH STREQUAL "i386")
53        list(APPEND SOURCE msvc-thiscall.c)
54    endif()
55    set_source_files_properties(bitmap.c PROPERTIES COMPILE_OPTIONS "/FImsvc.h")
56    list(APPEND PCH_SKIP_SOURCE bitmap.c)
57else()
58    list(APPEND SOURCE bitmap.c)
59endif()
60
61list(APPEND PCH_SKIP_SOURCE
62    guid.c
63    ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
64    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs_stubs.c
65    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs_wincodec_p.c)
66
67add_library(windowscodecs MODULE
68    ${SOURCE}
69    ${PCH_SKIP_SOURCE}
70    version.rc
71    ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def)
72
73if(MSVC)
74    # Disable warning C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *'
75    # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
76    target_compile_options(windowscodecs PRIVATE /wd4133 /wd4146)
77
78    target_compile_options(windowscodecs PRIVATE /FItypeof.h)
79endif()
80
81set_module_type(windowscodecs win32dll)
82target_link_libraries(windowscodecs wine uuid ${PSEH_LIB})
83add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista propsys msvcrt kernel32 ntdll)
84add_pch(windowscodecs precomp.h "${PCH_SKIP_SOURCE}")
85add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all)
86