2011-05-16 13:12:07 +00:00
|
|
|
|
2012-06-12 22:28:46 +00:00
|
|
|
PROJECT(NTOS)
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
include(ntos.cmake)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
set(NTOSKRNL_SOURCE ${SOURCE})
|
|
|
|
set(NTOSKRNL_ASM_SOURCE ${ASM_SOURCE})
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
set(NTKRNLMP_SOURCE ${SOURCE})
|
|
|
|
set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
|
|
|
|
add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
|
2013-01-08 20:33:08 +00:00
|
|
|
|
2012-04-13 21:35:00 +00:00
|
|
|
add_executable(ntoskrnl
|
2013-01-08 20:33:08 +00:00
|
|
|
${ntoskrnl_asm}
|
2014-02-10 17:12:41 +00:00
|
|
|
${NTOSKRNL_SOURCE}
|
|
|
|
guid.c
|
|
|
|
ntoskrnl.rc
|
2012-04-13 21:35:00 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
|
2019-02-03 11:57:20 +00:00
|
|
|
set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
|
2019-04-06 11:22:50 +00:00
|
|
|
set_target_properties(ntoskrnl PROPERTIES DEFINE_SYMBOL "")
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
2012-12-22 10:47:06 +00:00
|
|
|
set_entrypoint(ntoskrnl KiSystemStartup 4)
|
2011-06-06 19:08:39 +00:00
|
|
|
else()
|
2012-12-22 10:47:06 +00:00
|
|
|
set_entrypoint(ntoskrnl KiSystemStartup)
|
2011-06-06 19:08:39 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
set_subsystem(ntoskrnl native)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set_image_base(ntoskrnl 0x00400000)
|
2015-09-03 09:29:26 +00:00
|
|
|
add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
|
2019-06-29 17:24:28 +00:00
|
|
|
add_target_link_flags(ntoskrnl "/SECTION:INIT,D")
|
2011-05-16 13:12:07 +00:00
|
|
|
else()
|
2014-10-11 13:43:02 +00:00
|
|
|
if(GDB)
|
|
|
|
set_image_base(ntoskrnl 0x00800000)
|
|
|
|
else()
|
|
|
|
set_image_base(ntoskrnl 0x80800000)
|
|
|
|
endif()
|
2019-07-07 14:06:25 +00:00
|
|
|
#Disabled due to LD bug: ROSBE-154
|
|
|
|
#add_linker_script(ntoskrnl ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds)
|
2011-05-16 13:12:07 +00:00
|
|
|
endif()
|
|
|
|
|
2016-09-20 23:43:16 +00:00
|
|
|
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-10-04 20:26:14 +00:00
|
|
|
if(STACK_PROTECTOR)
|
|
|
|
target_link_libraries(ntoskrnl gcc_ssp)
|
2014-10-18 14:22:09 +00:00
|
|
|
elseif(RUNTIME_CHECKS)
|
|
|
|
target_link_libraries(ntoskrnl runtmchk)
|
2014-10-04 20:26:14 +00:00
|
|
|
endif()
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
add_importlibs(ntoskrnl hal kdcom bootvid)
|
2014-02-10 17:12:41 +00:00
|
|
|
add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTOSKRNL_SOURCE)
|
2011-05-16 13:12:07 +00:00
|
|
|
add_dependencies(ntoskrnl psdk bugcodes asm)
|
|
|
|
add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
|
2012-03-07 21:21:27 +00:00
|
|
|
|
2012-04-13 16:16:39 +00:00
|
|
|
if(BUILD_MP)
|
2014-02-10 17:12:41 +00:00
|
|
|
add_subdirectory(ntkrnlmp)
|
2012-04-13 16:16:39 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-01-08 20:33:08 +00:00
|
|
|
add_asm_files(ntdllsys_asm ntdll.S)
|
|
|
|
add_library(ntdllsys ${ntdllsys_asm})
|
|
|
|
set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
|
2017-07-25 17:30:21 +00:00
|
|
|
add_dependencies(ntdllsys asm)
|