Sync with trunk r63831.
[reactos.git] / ntoskrnl / CMakeLists.txt
1
2 PROJECT(NTOS)
3
4 include(ntos.cmake)
5
6 set(NTOSKRNL_SOURCE ${SOURCE})
7 set(NTOSKRNL_ASM_SOURCE ${ASM_SOURCE})
8
9 set(NTKRNLMP_SOURCE ${SOURCE})
10 set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
11
12 spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
13
14 add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
15
16 add_executable(ntoskrnl
17 ${ntoskrnl_asm}
18 ${NTOSKRNL_SOURCE}
19 guid.c
20 ntoskrnl.rc
21 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
22
23 if(ARCH STREQUAL "i386")
24 set_entrypoint(ntoskrnl KiSystemStartup 4)
25 else()
26 set_entrypoint(ntoskrnl KiSystemStartup)
27 endif()
28 set_subsystem(ntoskrnl native)
29
30 if(MSVC)
31 set_image_base(ntoskrnl 0x00400000)
32 else()
33 set_image_base(ntoskrnl 0x80800000)
34 endif()
35
36 target_link_libraries(ntoskrnl
37 cportlib
38 csq
39 ${PSEH_LIB}
40 cmlib
41 rtl
42 ${ROSSYM_LIB}
43 libcntpr
44 wdmguid
45 ioevent)
46
47 add_importlibs(ntoskrnl hal kdcom bootvid)
48 add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTOSKRNL_SOURCE)
49 add_dependencies(ntoskrnl psdk bugcodes asm)
50 add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
51
52 if(BUILD_MP)
53 add_subdirectory(ntkrnlmp)
54 endif()
55
56 add_asm_files(ntdllsys_asm ntdll.S)
57 add_library(ntdllsys ${ntdllsys_asm})
58 set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")