[CMAKE] Fix host tools build on x86-64 mingw
[reactos.git] / sdk / tools / widl / CMakeLists.txt
1
2 if(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()
11 endif()
12
13 list(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
35 add_definitions(-DINT16=SHORT)
36 add_host_tool(widl ${SOURCE})
37 target_link_libraries(widl PRIVATE host_includes wpphost)
38
39 if(MSVC)
40 # Disable warning "'>': signed/unsigned mismatch"
41 add_target_compile_flags(widl "/wd4018")
42
43 # Disable warning "unary minus operator applied to unsigned type, result still unsigned"
44 add_target_compile_flags(widl "/wd4146")
45
46 # Disable warning "'=': conversion from 'a' to 'b', possible loss of data"
47 add_target_compile_flags(widl "/wd4244")
48 endif()