xref: /reactos/dll/ntdll/CMakeLists.txt (revision 58aee30e)
1
2spec2def(ntdll.dll def/ntdll.spec ADD_IMPORTLIB)
3
4add_definitions(
5    -D__NTDLL__
6    -D_NTOSKRNL_
7    -DCRTDLL)
8
9include_directories(
10    BEFORE include
11    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys)
12
13list(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
29if(ARCH STREQUAL "i386")
30    list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
31elseif(ARCH STREQUAL "amd64")
32    list(APPEND ASM_SOURCE dispatch/amd64/dispatch.S)
33elseif(ARCH STREQUAL "arm")
34    list(APPEND ASM_SOURCE dispatch/arm/stubs_asm.s)
35else()
36    list(APPEND SOURCE dispatch/dispatch.c)
37endif()
38
39add_asm_files(ntdll_asm ${ASM_SOURCE})
40
41add_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
48set_module_type(ntdll win32dll ENTRYPOINT 0)
49#############################################
50## HACK FOR MSVC COMPILATION WITH win32dll ##
51set_subsystem(ntdll console)
52################# END  HACK #################
53
54if(MSVC)
55    add_target_link_flags(ntdll "/RELEASE")
56endif()
57
58target_link_libraries(ntdll rtl ntdllsys libcntpr uuid ${PSEH_LIB})
59add_pch(ntdll include/ntdll.h SOURCE)
60add_dependencies(ntdll ntstatus asm)
61add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
62