ad93da42c567fdd4c1ca053690d4b2de252be26c
[reactos.git] / reactos / dll / win32 / dbghelp / CMakeLists.txt
1
2 if(NOT CMAKE_CROSSCOMPILING)
3 add_definitions(-DDBGHELP_STATIC_LIB)
4
5 if(ARCH STREQUAL "i386")
6 add_definitions(-D_X86_)
7 endif()
8
9 include_directories(
10 ${REACTOS_SOURCE_DIR}/tools
11 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib)
12
13 list(APPEND SOURCE
14 compat.c
15 dbghelp.c
16 dwarf.c
17 module.c
18 pe_module.c
19 source.c
20 stabs.c
21 storage.c
22 symbol.c
23 type.c)
24
25 if(ARCH STREQUAL "i386")
26 list(APPEND SOURCE cpu_i386.c)
27 endif()
28
29 add_library(dbghelphost ${SOURCE})
30 else()
31 add_definitions(
32 -D__WINESRC__
33 -D_WINE
34 -DHAVE_ALLOCA_H
35 -D_IMAGEHLP_SOURCE_)
36
37 if(ARCH STREQUAL "amd64")
38 add_definitions(-DUNW_FLAG_NHANDLER=0 -DUNW_FLAG_EHANDLER=1 -DUNW_FLAG_UHANDLER=2 -DUNW_FLAG_CHAININFO=3)
39 endif()
40
41 include_directories(
42 BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
43 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib)
44
45 spec2def(dbghelp.dll dbghelp.spec ADD_IMPORTLIB)
46
47 list(APPEND SOURCE
48 coff.c
49 cpu_arm.c
50 cpu_arm64.c
51 cpu_i386.c
52 cpu_ppc.c
53 cpu_x86_64.c
54 crc32.c
55 dbghelp.c
56 dwarf.c
57 elf_module.c
58 image.c
59 macho_module.c
60 minidump.c
61 module.c
62 msc.c
63 path.c
64 pe_module.c
65 rosstubs.c
66 source.c
67 stabs.c
68 stack.c
69 storage.c
70 symbol.c
71 type.c
72 dbghelp_private.h
73 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c)
74
75 add_library(dbghelp SHARED
76 ${SOURCE}
77 version.rc
78 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def)
79
80 set_module_type(dbghelp win32dll)
81 target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames zlib)
82 add_delay_importlibs(dbghelp version)
83 add_importlibs(dbghelp psapi msvcrt kernel32 ntdll)
84 add_pch(dbghelp dbghelp_private.h SOURCE)
85 add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
86
87 endif()