[FMIFS]
[reactos.git] / reactos / dll / ntdll / CMakeLists.txt
1
2 spec2def(ntdll.dll def/ntdll.spec ADD_IMPORTLIB)
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 ${REACTOS_SOURCE_DIR}/win32ss/include)
13
14 list(APPEND SOURCE
15 csr/api.c
16 csr/capture.c
17 csr/connect.c
18 dbg/dbgui.c
19 ldr/ldrapi.c
20 ldr/ldrinit.c
21 ldr/ldrpe.c
22 ldr/ldrutils.c
23 rtl/libsupp.c
24 rtl/version.c
25 include/ntdll.h)
26
27 if(ARCH STREQUAL "i386")
28 list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
29 elseif(ARCH STREQUAL "amd64")
30 list(APPEND ASM_SOURCE dispatch/amd64/dispatch.S)
31 elseif(ARCH STREQUAL "arm")
32 list(APPEND ASM_SOURCE dispatch/arm/stubs_asm.s)
33 else()
34 list(APPEND SOURCE dispatch/dispatch.c)
35 endif()
36
37 add_asm_files(ntdll_asm ${ASM_SOURCE})
38
39 add_library(ntdll SHARED
40 ${SOURCE}
41 ${ntdll_asm}
42 def/ntdll.rc
43 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c
44 ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
45
46 set_module_type(ntdll win32dll HOTPATCHABLE ENTRYPOINT 0)
47 #############################################
48 ## HACK FOR MSVC COMPILATION WITH win32dll ##
49 set_subsystem(ntdll console)
50 ################# END HACK #################
51
52 if(MSVC)
53 add_target_link_flags(ntdll "/RELEASE")
54 endif()
55
56 target_link_libraries(ntdll
57 rtl
58 ntdllsys
59 libcntpr
60 uuid
61 ${PSEH_LIB})
62
63 add_pch(ntdll include/ntdll.h SOURCE)
64 add_dependencies(ntdll ntstatus asm)
65
66 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
67