Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / 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}/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 ${REACTOS_SOURCE_DIR}/include/reactos/wine
43 ${REACTOS_SOURCE_DIR}/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 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c
73 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def)
74
75 add_library(dbghelp SHARED ${SOURCE} version.rc)
76
77 if(NOT MSVC)
78 # FIXME: http://www.cmake.org/Bug/view.php?id=12998
79 #allow_warnings(dbghelp)
80 set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error")
81 endif()
82
83 set_module_type(dbghelp win32dll)
84 target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames zlib)
85 add_delay_importlibs(dbghelp version)
86 add_importlibs(dbghelp psapi msvcrt kernel32 ntdll)
87 add_pch(dbghelp dbghelp_private.h)
88 add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
89
90 endif()