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