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__WINESRC__ 30 -D_WINE 31 -DHAVE_ALLOCA_H 32 -D_IMAGEHLP_SOURCE_) 33 34 include_directories( 35 BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) 36 37 spec2def(dbghelp.dll dbghelp.spec ADD_IMPORTLIB) 38 39 list(APPEND SOURCE 40 coff.c 41 cpu_arm.c 42 cpu_arm64.c 43 cpu_i386.c 44 cpu_x86_64.c 45 dbghelp.c 46 dwarf.c 47# elf_module.c 48 image.c 49# macho_module.c 50 inflate.c 51 minidump.c 52 module.c 53 msc.c 54 path.c 55 pe_module.c 56 rosstubs.c 57 rsym.c 58 source.c 59 stabs.c 60 stack.c 61 storage.c 62 symbol.c 63 type.c 64 precomp.h) 65 66 add_library(dbghelp MODULE 67 ${SOURCE} 68 version.rc 69 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c 70 ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def) 71 72 set_module_type(dbghelp win32dll) 73 target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames) 74 add_delay_importlibs(dbghelp version) 75 add_importlibs(dbghelp psapi msvcrt kernel32 ntdll) 76 add_pch(dbghelp precomp.h SOURCE) 77 add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all) 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() 85