* Sync up to trunk head (r65394).
[reactos.git] / ntoskrnl / ntkrnlmp / CMakeLists.txt
1
2 include(../ntos.cmake)
3
4 include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl)
5 spec2def(ntkrnlmp.exe ../ntoskrnl.spec)
6
7 if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS"))
8 set_source_files_properties(${NTKRNLMP_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "CONFIG_SMP")
9 endif()
10
11 add_asm_files(ntkrnlmp_asm ${NTKRNLMP_ASM_SOURCE})
12
13 add_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)
19
20 add_target_compile_definitions(ntkrnlmp CONFIG_SMP)
21
22 if(ARCH STREQUAL "i386")
23 set_entrypoint(ntkrnlmp KiSystemStartup 4)
24 else()
25 set_entrypoint(ntkrnlmp KiSystemStartup)
26 endif()
27 set_subsystem(ntkrnlmp native)
28
29 if(MSVC)
30 set_image_base(ntkrnlmp 0x00400000)
31 else()
32 set_image_base(ntkrnlmp 0x80800000)
33 endif()
34
35 if(STACK_PROTECTOR)
36 target_link_libraries(ntkrnlmp gcc_ssp)
37 elseif(RUNTIME_CHECKS)
38 target_link_libraries(ntkrnlmp runtmchk)
39 endif()
40
41 target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
42 add_importlibs(ntkrnlmp hal kdcom bootvid)
43 add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE)
44 add_dependencies(ntkrnlmp psdk bugcodes asm)
45 add_cd_file(TARGET ntkrnlmp DESTINATION reactos/system32 NO_CAB FOR all)