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