- Update to r53061
[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/ldrapi.c
19 ldr/ldrinit.c
20 ldr/ldrpe.c
21 ldr/ldrutils.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 ${SOURCE})
38
39 set_entrypoint(ntdll 0)
40
41 if(MSVC)
42 target_link_libraries(ntdll rtl)
43 add_linkerflag(ntdll /RELEASE)
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 set_image_base(ntdll ${baseaddress_ntdll})
54 add_pch(ntdll include/ntdll.h)
55 add_dependencies(ntdll ntstatus asm)
56
57 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
58 add_importlib_target(def/ntdll.spec)