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 38add_definitions(-DINT16=SHORT) 39add_host_tool(widl ${SOURCE}) 40target_link_libraries(widl PRIVATE host_includes wpphost) 41 42if(MSVC) 43 # Disable warning "'>': signed/unsigned mismatch" 44 target_compile_options(widl PRIVATE "/wd4018") 45 46 # Disable warning "unary minus operator applied to unsigned type, result still unsigned" 47 target_compile_options(widl PRIVATE "/wd4146") 48 49 # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" 50 target_compile_options(widl PRIVATE "/wd4244") 51endif() 52