summaryrefslogtreecommitdiff
path: root/src/dlls/dbgshim/CMakeLists.txt
blob: c5b8b9f48317d21cfbb9aff21d848243f20a66ae (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
add_definitions(-DFEATURE_NO_HOST)
add_definitions(-DSELF_NO_HOST)

set(DBGSHIM_SOURCES
    dbgshim.cpp
)

if(WIN32)
    # Use static crt
    add_definitions(-MT) 
    add_definitions(-DFX_VER_INTERNALNAME_STR=dbgshim.dll)

    list(APPEND DBGSHIM_SOURCES
        dbgshim.rc
    )

    preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
    list(APPEND DBGSHIM_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
endif(WIN32)

if(CLR_CMAKE_PLATFORM_UNIX)
    add_compile_options(-fPIC)
endif(CLR_CMAKE_PLATFORM_UNIX)

if(CLR_CMAKE_PLATFORM_LINUX)
    # This option is necessary to ensure that the overloaded delete operator defined inside
    # of the utilcode will be used instead of the standard library delete operator.
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
endif(CLR_CMAKE_PLATFORM_LINUX)

add_library(dbgshim SHARED ${DBGSHIM_SOURCES})

set(DBGSHIM_LIBRARIES
    debug-pal
    debugshim
    corguids
    dbgutil
    utilcodestaticnohost
)

if(WIN32)
    list(APPEND DBGSHIM_LIBRARIES
        kernel32.lib
        ${STATIC_MT_CRT_LIB}
        uuid.lib
        user32.lib
        advapi32.lib
        oleaut32.lib
        WtsApi32.lib
        version.lib
        psapi.lib
    )
else()
    list(APPEND DBGSHIM_LIBRARIES
        coreclrpal
        palrt
    )
endif(WIN32)

target_link_libraries(dbgshim ${DBGSHIM_LIBRARIES})

# add the install targets
install (TARGETS dbgshim DESTINATION .)
if(WIN32)
    install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/dbgshim.pdb DESTINATION PDB)
endif(WIN32)