[NTDLL:LDR] Avoid passing an uninitialized variable to another function.
[reactos.git] / 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}/sdk/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 ldr/verifier.c
23 rtl/libsupp.c
24 rtl/uilist.c
25 rtl/version.c
26 etw/trace.c
27 include/ntdll.h)
28
29 if(ARCH STREQUAL "i386")
30 list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
31 elseif(ARCH STREQUAL "amd64")
32 list(APPEND ASM_SOURCE dispatch/amd64/dispatch.S)
33 elseif(ARCH STREQUAL "arm")
34 list(APPEND ASM_SOURCE dispatch/arm/stubs_asm.s)
35 else()
36 list(APPEND SOURCE dispatch/dispatch.c)
37 endif()
38
39 add_asm_files(ntdll_asm ${ASM_SOURCE})
40
41 add_library(ntdll SHARED
42 ${SOURCE}
43 ${ntdll_asm}
44 def/ntdll.rc
45 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c
46 ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
47
48 set_module_type(ntdll win32dll ENTRYPOINT 0)
49 #############################################
50 ## HACK FOR MSVC COMPILATION WITH win32dll ##
51 set_subsystem(ntdll console)
52 ################# END HACK #################
53
54 if(MSVC)
55 add_target_link_flags(ntdll "/RELEASE")
56 endif()
57
58 target_link_libraries(ntdll rtl ntdllsys libcntpr uuid ${PSEH_LIB})
59 add_pch(ntdll include/ntdll.h SOURCE)
60 add_dependencies(ntdll ntstatus asm)
61 add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)