0c1adcfa2f7a5d6e33e8335f921cf39878bcc0fc
[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 def/ntdll.def)
25
26 set_source_files_properties(def/ntdll.def PROPERTIES EXTERNAL_OBJECT TRUE)
27
28 if(ARCH MATCHES i386)
29 list(APPEND SOURCE dispatch/i386/dispatch.S)
30 elseif(ARCH MATCHES amd64)
31 list(APPEND SOURCE dispatch/amd64/stubs.c)
32 elseif(ARCH MATCHES arm)
33 list(APPEND SOURCE dispatch/arm/stubs_asm.s)
34 else()
35 list(APPEND SOURCE dispatch/dispatch.c)
36 endif(ARCH MATCHES i386)
37
38 add_library(ntdll SHARED
39 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_ntdll.h.gch
40 ${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 ${CMAKE_CURRENT_BINARY_DIR}/def/ntdll.def
52 ntdllsys
53 libcntpr
54 pseh)
55
56 add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE})
57 add_dependencies(ntdll ntstatus)
58
59 add_minicd_target(ntdll reactos/system32 ntdll.dll)
60 add_cab_target(ntdll 1)
61 add_importlib_target(ntdll)