xref: /reactos/sdk/tools/widl/CMakeLists.txt (revision 682f85ad)
1
2if(MSVC)
3    if(MSVC_VERSION LESS 1900)
4        add_definitions(-Dsnprintf=_snprintf)
5
6        # Add this definition for WDK only, VS 9 doesn't like that
7        if(DEFINED ENV{DDKBUILDENV})
8            add_definitions(-Dvsnprintf=_vsnprintf)
9        endif()
10    endif()
11endif()
12
13FLEX_TARGET(p_scanner parser.l ${CMAKE_CURRENT_BINARY_DIR}/parser.yy.c)
14BISON_TARGET(p_parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.tab.c COMPILE_FLAGS "-p parser_")
15ADD_FLEX_BISON_DEPENDENCY(p_scanner p_parser)
16
17list(APPEND SOURCE
18    client.c
19    expr.c
20    hash.c
21    header.c
22    proxy.c
23    register.c
24    server.c
25    typegen.c
26    typelib.c
27    typetree.c
28    utils.c
29    widl.c
30    write_msft.c
31    write_sltg.c
32    ${FLEX_p_scanner_OUTPUTS}
33    ${BISON_p_parser_OUTPUTS}
34    ../port/getopt.c
35    ../port/getopt1.c
36    ../port/mkstemps.c)
37
38# Taken from widl.rbuild
39add_definitions(-DINT16=SHORT)
40add_host_tool(widl ${SOURCE})
41target_link_libraries(widl PRIVATE host_includes wpphost)
42
43if(MSVC)
44    # Disable warning "'>': signed/unsigned mismatch"
45    target_compile_options(widl PRIVATE "/wd4018")
46
47    # Disable warning "unary minus operator applied to unsigned type, result still unsigned"
48    target_compile_options(widl PRIVATE "/wd4146")
49
50    # Disable warning "'=': conversion from 'a' to 'b', possible loss of data"
51    target_compile_options(widl PRIVATE "/wd4244")
52endif()
53