[CMAKE]
[reactos.git] / dll / ntdll / CMakeLists.txt
1
2 add_definitions(
3 -D__NTDLL__
4 -D_NTOSKRNL_
5 -DCRTDLL)
6
7 include_directories(
8 BEFORE include
9 ${REACTOS_SOURCE_DIR}/include/reactos/subsys)
10
11 list(APPEND SOURCE
12 csr/api.c
13 csr/capture.c
14 csr/connect.c
15 dbg/dbgui.c
16 ldr/startup.c
17 ldr/utils.c
18 ldr/actctx.c
19 rtl/libsupp.c
20 rtl/version.c
21 def/ntdll.rc)
22
23 if(ARCH MATCHES i386)
24 list(APPEND SOURCE dispatch/i386/dispatch.S)
25 elseif(ARCH MATCHES amd64)
26 list(APPEND SOURCE dispatch/amd64/stubs.c)
27 elseif(ARCH MATCHES arm)
28 list(APPEND SOURCE dispatch/arm/stubs_asm.s)
29 else()
30 list(APPEND SOURCE dispatch/dispatch.c)
31 endif(ARCH MATCHES i386)
32
33 add_library(ntdll SHARED
34 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_ntdll.h.gch
35 ${SOURCE})
36
37 set_entrypoint(ntdll 0)
38
39 if(MSVC)
40 target_link_libraries(ntdll rtl)
41 else()
42 target_link_libraries(ntdll -Wl,--whole-archive rtl -Wl,--no-whole-archive)
43 endif()
44
45 target_link_libraries(ntdll
46 ${CMAKE_CURRENT_SOURCE_DIR}/def/ntdll.def
47 ntdllsys
48 libcntpr
49 pseh)
50
51 add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE})
52 add_dependencies(ntdll ntstatus)
53
54 add_minicd_target(ntdll reactos/system32 ntdll.dll)
55 add_cab_target(ntdll 1)