summaryrefslogtreecommitdiff
path: root/src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
blob: 2daeaabfa371c28dec138185087ba28ac61f191b (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
project(unixcoreconsole)

include_directories(../unixcoreruncommon)

add_compile_options(-fPIE)

set(CORECONSOLE_SOURCES 
    coreconsole.cpp 
)

_add_executable(coreconsole
    ${CORECONSOLE_SOURCES}
)

# FreeBSD and NetBSD implement dlopen(3) in libc
if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
    target_link_libraries(coreconsole 
        dl
    )
endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)

# Libc turns locks into no-ops if pthread was not loaded into process yet. Loading
# pthread by the process executable ensures that all locks are initialized properly.
target_link_libraries(coreconsole
    unixcoreruncommon
)

if(NOT CLR_CMAKE_PLATFORM_ANDROID)
  target_link_libraries(coreconsole
    pthread
  )
endif()

install_clr(coreconsole)