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