[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/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
41 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_ntdll.h.gch
42 ${SOURCE})
43
44 set_entrypoint(ntdll 0)
45
46 if(MSVC)
47 target_link_libraries(ntdll rtl)
48 else()
49 target_link_libraries(ntdll -Wl,--whole-archive rtl -Wl,--no-whole-archive)
50 endif()
51
52 target_link_libraries(ntdll
53 ntdllsys
54 libcntpr
55 ${PSEH_LIB})
56
57 set_image_base(ntdll ${baseaddress_ntdll})
58 add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE})
59 add_dependencies(ntdll ntstatus asm)
60
61 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
62 add_importlib_target(def/ntdll.spec)