1 2if(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}) 30else() 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 rsym.c 67 source.c 68 stabs.c 69 stack.c 70 storage.c 71 symbol.c 72 type.c 73 precomp.h) 74 75 add_library(dbghelp SHARED 76 ${SOURCE} 77 version.rc 78 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c 79 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def) 80 81 set_module_type(dbghelp win32dll) 82 target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames zlib) 83 add_delay_importlibs(dbghelp version) 84 add_importlibs(dbghelp psapi msvcrt kernel32 ntdll) 85 add_pch(dbghelp precomp.h SOURCE) 86 add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all) 87 88endif() 89