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