Merge pull request #1335 from ariscop/CMP0065
[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 set_property(TARGET ntkrnlmp PROPERTY ENABLE_EXPORTS TRUE)
20
21 add_target_compile_definitions(ntkrnlmp CONFIG_SMP)
22
23 if(ARCH STREQUAL "i386")
24 set_entrypoint(ntkrnlmp KiSystemStartup 4)
25 else()
26 set_entrypoint(ntkrnlmp KiSystemStartup)
27 endif()
28 set_subsystem(ntkrnlmp native)
29
30 if(MSVC)
31 set_image_base(ntkrnlmp 0x00400000)
32 add_target_link_flags(ntkrnlmp "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
33 else()
34 set_image_base(ntkrnlmp 0x80800000)
35 endif()
36
37 if(STACK_PROTECTOR)
38 target_link_libraries(ntkrnlmp gcc_ssp)
39 elseif(RUNTIME_CHECKS)
40 target_link_libraries(ntkrnlmp runtmchk)
41 endif()
42
43 target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
44 add_importlibs(ntkrnlmp hal kdcom bootvid)
45 add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE)
46 add_dependencies(ntkrnlmp psdk bugcodes asm)
47 add_cd_file(TARGET ntkrnlmp DESTINATION reactos/system32 NO_CAB FOR all)