Reactos
1
2if(NOT CMAKE_CROSSCOMPILING)
3 add_definitions(-DDBGHELP_STATIC_LIB -DNONAMELESSUNION)
4
5 include_directories(
6 ${REACTOS_SOURCE_DIR}/tools)
7
8 list(APPEND SOURCE
9 compat.c
10 dbghelp.c
11 dwarf.c
12 inflate.c
13 module.c
14 pe_module.c
15 source.c
16 stabs.c
17 storage.c
18 symbol.c
19 type.c)
20
21 if(ARCH STREQUAL "i386")
22 list(APPEND SOURCE cpu_i386.c)
23 endif()
24
25 add_library(dbghelphost ${SOURCE})
26 target_link_libraries(dbghelphost PRIVATE host_includes)
27else()
28 add_definitions(
29 -D_WINE
30 -DHAVE_ALLOCA_H
31 -D_IMAGEHLP_SOURCE_)
32
33 include_directories(
34 BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/wine)
35
36 spec2def(dbghelp.dll dbghelp.spec ADD_IMPORTLIB)
37
38 list(APPEND SOURCE
39 coff.c
40 cpu_arm.c
41 cpu_arm64.c
42 cpu_i386.c
43 cpu_x86_64.c
44 dbghelp.c
45 dwarf.c
46# elf_module.c
47 image.c
48# macho_module.c
49 inflate.c
50 minidump.c
51 module.c
52 msc.c
53 path.c
54 pe_module.c
55 rosstubs.c
56 rsym.c
57 source.c
58 stabs.c
59 stack.c
60 storage.c
61 symbol.c
62 type.c
63 precomp.h)
64
65 add_library(dbghelp MODULE
66 ${SOURCE}
67 version.rc
68 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c
69 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def)
70
71 set_module_type(dbghelp win32dll)
72 target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames)
73 add_delay_importlibs(dbghelp version)
74 add_importlibs(dbghelp psapi msvcrt kernel32 ntdll)
75 add_pch(dbghelp precomp.h SOURCE)
76 add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
77 set_wine_module_FIXME(dbghelp) # CORE-5743: No ARRAY_SIZE macro
78
79 if(MSVC)
80 # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
81 # Disable warning C4477 (printf format warnings)
82 target_compile_options(dbghelp PRIVATE /wd4146 /wd4477)
83 endif()
84endif()