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 13list(APPEND SOURCE 14 client.c 15 expr.c 16 hash.c 17 header.c 18 proxy.c 19 register.c 20 server.c 21 typegen.c 22 typelib.c 23 typetree.c 24 utils.c 25 widl.c 26 write_msft.c 27 write_sltg.c 28 parser.yy.c 29 parser.tab.c 30 ../port/getopt.c 31 ../port/getopt1.c 32 ../port/mkstemps.c) 33 34# Taken from widl.rbuild 35add_definitions(-DINT16=SHORT) 36add_host_tool(widl ${SOURCE}) 37target_link_libraries(widl PRIVATE host_includes wpphost) 38 39if(MSVC) 40 # Disable warning "'>': signed/unsigned mismatch" 41 target_compile_options(widl PRIVATE "/wd4018") 42 43 # Disable warning "unary minus operator applied to unsigned type, result still unsigned" 44 target_compile_options(widl PRIVATE "/wd4146") 45 46 # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" 47 target_compile_options(widl PRIVATE "/wd4244") 48endif() 49