Revert [NOTEPAD] Add SBS_SIZEGRIP to status bar CORE-16528
[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 set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
22 set_target_properties(ntoskrnl PROPERTIES DEFINE_SYMBOL "")
23
24 if(ARCH STREQUAL "i386")
25 set_entrypoint(ntoskrnl KiSystemStartup 4)
26 else()
27 set_entrypoint(ntoskrnl KiSystemStartup)
28 endif()
29 set_subsystem(ntoskrnl native)
30
31 if(MSVC)
32 set_image_base(ntoskrnl 0x00400000)
33 add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
34 add_target_link_flags(ntoskrnl "/SECTION:INIT,D")
35 else()
36 if(GDB)
37 set_image_base(ntoskrnl 0x00800000)
38 else()
39 set_image_base(ntoskrnl 0x80800000)
40 endif()
41 #Disabled due to LD bug: ROSBE-154
42 #add_linker_script(ntoskrnl ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds)
43 endif()
44
45 target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
46
47 if(STACK_PROTECTOR)
48 target_link_libraries(ntoskrnl gcc_ssp)
49 elseif(RUNTIME_CHECKS)
50 target_link_libraries(ntoskrnl runtmchk)
51 endif()
52
53 add_importlibs(ntoskrnl hal kdcom bootvid)
54 add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTOSKRNL_SOURCE)
55 add_dependencies(ntoskrnl psdk bugcodes asm)
56 add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
57
58 if(BUILD_MP)
59 add_subdirectory(ntkrnlmp)
60 endif()
61
62 add_asm_files(ntdllsys_asm ntdll.S)
63 add_library(ntdllsys ${ntdllsys_asm})
64 set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
65 add_dependencies(ntdllsys asm)