1 2include(../ntos.cmake) 3 4include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl) 5spec2def(ntkrnlmp.exe ../ntoskrnl.spec) 6 7if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS")) 8 set_source_files_properties(${NTKRNLMP_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "CONFIG_SMP") 9endif() 10 11add_asm_files(ntkrnlmp_asm ${NTKRNLMP_ASM_SOURCE}) 12 13add_executable(ntkrnlmp 14 ${ntkrnlmp_asm} 15 ${NTKRNLMP_SOURCE} 16 ${REACTOS_SOURCE_DIR}/ntoskrnl/guid.c 17 ${REACTOS_SOURCE_DIR}/ntoskrnl/ntoskrnl.rc 18 ${CMAKE_CURRENT_BINARY_DIR}/ntkrnlmp.def) 19set_property(TARGET ntkrnlmp PROPERTY ENABLE_EXPORTS TRUE) 20 21target_compile_definitions(ntkrnlmp PRIVATE CONFIG_SMP) 22 23if(ARCH STREQUAL "i386") 24 set_entrypoint(ntkrnlmp KiSystemStartup 4) 25else() 26 set_entrypoint(ntkrnlmp KiSystemStartup) 27endif() 28set_subsystem(ntkrnlmp native) 29 30if(MSVC) 31 set_image_base(ntkrnlmp 0x00400000) 32 add_target_link_flags(ntkrnlmp "/SECTION:.rsrc,!DP") #Accessed from bugcheck code 33else() 34 set_image_base(ntkrnlmp 0x80800000) 35endif() 36 37# dynamic analysis switches 38if(STACK_PROTECTOR) 39 target_link_libraries(ntkrnlmp gcc_ssp) 40endif() 41 42if(RUNTIME_CHECKS) 43 target_link_libraries(ntkrnlmp runtmchk) 44endif() 45 46target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} arbiter cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent) 47add_importlibs(ntkrnlmp hal kdcom bootvid) 48add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE) 49add_dependencies(ntkrnlmp psdk bugcodes asm) 50add_cd_file(TARGET ntkrnlmp DESTINATION reactos/system32 NO_CAB FOR all) 51