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