[FREELDR]
[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/startup.c
19 ldr/utils.c
20 ldr/actctx.c
21 rtl/libsupp.c
22 rtl/version.c
23 def/ntdll.rc
24 ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
25
26 if(ARCH MATCHES i386)
27 list(APPEND SOURCE dispatch/i386/dispatch.S)
28 elseif(ARCH MATCHES amd64)
29 list(APPEND SOURCE dispatch/amd64/stubs.c)
30 elseif(ARCH MATCHES arm)
31 list(APPEND SOURCE dispatch/arm/stubs_asm.s)
32 else()
33 list(APPEND SOURCE dispatch/dispatch.c)
34 endif(ARCH MATCHES i386)
35
36 add_library(ntdll SHARED
37 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_ntdll.h.gch
38 ${SOURCE})
39
40 set_entrypoint(ntdll 0)
41
42 if(MSVC)
43 target_link_libraries(ntdll rtl)
44 else()
45 target_link_libraries(ntdll -Wl,--whole-archive rtl -Wl,--no-whole-archive)
46 endif()
47
48 target_link_libraries(ntdll
49 ntdllsys
50 libcntpr
51 ${PSEH_LIB})
52
53 add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE})
54 add_dependencies(ntdll ntstatus)
55
56 add_minicd_target(ntdll reactos/system32 ntdll.dll)
57 add_cab_target(ntdll 1)
58 add_importlib_target(def/ntdll.spec)