[CMAKE]
[reactos.git] / dll / ntdll / CMakeLists.txt
1
2 set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
3
4 add_definitions(-D__NTDLL__)
5 add_definitions(-D_NTOSKRNL_)
6 add_definitions(-DCRTDLL)
7
8 include_directories(BEFORE include)
9 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/subsys)
10
11 list(APPEND SOURCE
12 csr/api.c
13 csr/capture.c
14 csr/connect.c
15 dbg/dbgui.c
16 ldr/startup.c
17 ldr/utils.c
18 ldr/actctx.c
19 rtl/libsupp.c
20 rtl/version.c
21 def/ntdll.rc)
22
23 if(ARCH MATCHES i386)
24 list(APPEND SOURCE dispatch/i386/dispatch.S)
25 elseif(ARCH MATCHES amd64)
26 list(APPEND SOURCE dispatch/amd64/stubs.c)
27 elseif(ARCH MATCHES arm)
28 list(APPEND SOURCE dispatch/arm/stubs_asm.s)
29 else()
30 list(APPEND SOURCE dispatch/dispatch.c)
31 endif(ARCH MATCHES i386)
32
33 add_library(ntdll SHARED
34 ${SOURCE}
35 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_ntdll.h.gch)
36
37 set_target_properties(ntdll PROPERTIES LINK_FLAGS "-Wl,-entry,0")
38
39 target_link_libraries(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/def/ntdll.def
40 -Wl,--whole-archive rtl -Wl,--no-whole-archive
41 ntdllsys
42 libcntpr
43 pseh)
44
45 add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE})
46 add_dependencies(ntdll ntstatus version)