* Sync up to trunk head (r65074).
[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 add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
14
15 add_executable(ntoskrnl
16 ${ntoskrnl_asm}
17 ${NTOSKRNL_SOURCE}
18 guid.c
19 ntoskrnl.rc
20 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
21
22 if(ARCH STREQUAL "i386")
23 set_entrypoint(ntoskrnl KiSystemStartup 4)
24 else()
25 set_entrypoint(ntoskrnl KiSystemStartup)
26 endif()
27 set_subsystem(ntoskrnl native)
28
29 if(MSVC)
30 set_image_base(ntoskrnl 0x00400000)
31 else()
32 if(GDB)
33 set_image_base(ntoskrnl 0x00800000)
34 else()
35 set_image_base(ntoskrnl 0x80800000)
36 endif()
37 endif()
38
39 target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
40
41 if(STACK_PROTECTOR)
42 target_link_libraries(ntoskrnl gcc_ssp)
43 elseif(RUNTIME_CHECKS)
44 target_link_libraries(ntoskrnl runtmchk)
45 endif()
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")