summaryrefslogtreecommitdiff
path: root/src/debug/createdump/CMakeLists.txt
blob: edad62e2a67195782dadc8f670153fba9f2d126b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
project(createdump)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Set the RPATH of createdump so that it can find dependencies without needing to set LD_LIBRARY_PATH
# For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling.
if (CORECLR_SET_RPATH)
  set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
  if(CLR_CMAKE_PLATFORM_DARWIN)
    set(CMAKE_INSTALL_RPATH "@loader_path")
  else()
    set(CMAKE_INSTALL_RPATH "\$ORIGIN")
  endif(CLR_CMAKE_PLATFORM_DARWIN)
endif (CORECLR_SET_RPATH)

remove_definitions(-DUNICODE)
remove_definitions(-D_UNICODE)

include_directories(BEFORE ${VM_DIR})

add_definitions(-DPAL_STDCPP_COMPAT=1)

set(CREATEDUMP_SOURCES 
    createdump.cpp 
    crashinfo.cpp
    threadinfo.cpp
    datatarget.cpp
    dumpwriter.cpp
)

set(DNETMEMORYENUM_SOURCES
    dnetmemoryenumlib.cpp
    crashinfo.cpp
    threadinfo.cpp
    datatarget.cpp
)

_add_library(createdump_lib
    ${CREATEDUMP_SOURCES}
)

set_property(TARGET createdump_lib PROPERTY COMPILE_FLAGS "-fPIC")

_add_library(dnetmemoryenum SHARED
    ${DNETMEMORYENUM_SOURCES}
    ${PAL_REDEFINES_FILE}
)

set_property(TARGET dnetmemoryenum PROPERTY COMPILE_FLAGS "-fPIC")

_add_executable(createdump
    main.cpp
    ${PAL_REDEFINES_FILE}
)

set_property(TARGET createdump PROPERTY COMPILE_FLAGS "-fPIE")

add_dependencies(createdump pal_redefines_file)
add_dependencies(dnetmemoryenum pal_redefines_file)

target_link_libraries(createdump
    createdump_lib
    # share the PAL/corguids in the dac module
    mscordaccore
)

target_link_libraries(dnetmemoryenum
    # share the PAL in the dac module
    mscordaccore
)

add_dependencies(createdump mscordaccore)
add_dependencies(dnetmemoryenum mscordaccore)

install_clr(createdump)
install_clr(dnetmemoryenum)