xref: /reactos/sdk/tools/wpp/CMakeLists.txt (revision 019f21ee)
1
2if(MSVC)
3    if(MSVC_VERSION LESS 1900)
4        add_definitions(
5            -Dsnprintf=_snprintf
6            -Dstrtoull=_strtoui64
7            -Dstrtoll=_strtoi64)
8
9        # Add this definition for WDK only, VS 9 doesn't like that
10        if(DEFINED ENV{DDKBUILDENV})
11            add_definitions(-Dvsnprintf=_vsnprintf)
12        endif()
13    endif()
14
15    # Disable warning " unary minus operator applied to unsigned type, result still unsigned"
16    add_compile_flags("/wd4146")
17
18    # Disable warning "'=': conversion from 'a' to 'b', possible loss of data"
19    add_compile_flags("/wd4244")
20
21endif()
22
23if(CMAKE_CROSSCOMPILING)
24    add_definitions(
25        -D_DLL -D__USE_CRTIMP
26        -D__NO_ISOCEXT
27        -Dstrtoull=_strtoui64
28        -Dstrtoll=_strtoi64
29        -Dopen=_open
30        -Dclose=_close)
31    include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
32endif()
33
34list(APPEND SOURCE
35    preproc.c
36    wpp.c
37    ppl.yy.c
38    ppy.tab.c)
39
40if(CMAKE_CROSSCOMPILING)
41    add_library(wpp ${SOURCE})
42else()
43    add_library(wpphost ${SOURCE})
44    target_link_libraries(wpphost PRIVATE host_includes)
45endif()
46