[CMAKE]
[reactos.git] / reactos / 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/ldrapi.c
20 ldr/ldrinit.c
21 ldr/ldrpe.c
22 ldr/ldrutils.c
23 ldr/startup.c
24 ldr/utils.c
25 rtl/libsupp.c
26 rtl/version.c
27 def/ntdll.rc
28 ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
29
30 if(ARCH MATCHES i386)
31 list(APPEND SOURCE dispatch/i386/dispatch.S)
32 elseif(ARCH MATCHES amd64)
33 list(APPEND SOURCE dispatch/amd64/stubs.c)
34 elseif(ARCH MATCHES arm)
35 list(APPEND SOURCE dispatch/arm/stubs_asm.s)
36 else()
37 list(APPEND SOURCE dispatch/dispatch.c)
38 endif(ARCH MATCHES i386)
39
40 add_library(ntdll SHARED ${SOURCE})
41
42 set_entrypoint(ntdll 0)
43
44 if(MSVC)
45 target_link_libraries(ntdll rtl)
46 else()
47 target_link_libraries(ntdll -Wl,--whole-archive rtl -Wl,--no-whole-archive)
48 endif()
49
50 target_link_libraries(ntdll
51 ntdllsys
52 libcntpr
53 ${PSEH_LIB})
54
55 set_image_base(ntdll ${baseaddress_ntdll})
56 add_pch(ntdll include/ntdll.h)
57 add_dependencies(ntdll ntstatus asm)
58
59 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
60 add_importlib_target(def/ntdll.spec)