* Sync up to trunk head (r64716).
[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 if(GDB)
34 set_image_base(ntoskrnl 0x00800000)
35 else()
36 set_image_base(ntoskrnl 0x80800000)
37 endif()
38 endif()
39
40 target_link_libraries(ntoskrnl
41 cportlib
42 csq
43 ${PSEH_LIB}
44 cmlib
45 rtl
46 ${ROSSYM_LIB}
47 libcntpr
48 wdmguid
49 ioevent)
50
51 if(STACK_PROTECTOR)
52 target_link_libraries(ntoskrnl gcc_ssp)
53 endif()
54
55 add_importlibs(ntoskrnl hal kdcom bootvid)
56 add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTOSKRNL_SOURCE)
57 add_dependencies(ntoskrnl psdk bugcodes asm)
58 add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
59
60 if(BUILD_MP)
61 add_subdirectory(ntkrnlmp)
62 endif()
63
64 add_asm_files(ntdllsys_asm ntdll.S)
65 add_library(ntdllsys ${ntdllsys_asm})
66 set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")