[E1000] Create an initial driver skeleton
[reactos.git] / ntoskrnl / CMakeLists.txt
1
2 PROJECT(NTOS)
3
4 include(ntos.cmake)
5
6 set(NTOSKRNL_SOURCE ${SOURCE})
7 set(NTOSKRNL_ASM_SOURCE ${ASM_SOURCE})
8
9 set(NTKRNLMP_SOURCE ${SOURCE})
10 set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
11
12 spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
13 add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
14
15 add_executable(ntoskrnl
16 ${ntoskrnl_asm}
17 ${NTOSKRNL_SOURCE}
18 guid.c
19 ntoskrnl.rc
20 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
21 set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
22
23 if(ARCH STREQUAL "i386")
24 set_entrypoint(ntoskrnl KiSystemStartup 4)
25 else()
26 set_entrypoint(ntoskrnl KiSystemStartup)
27 endif()
28 set_subsystem(ntoskrnl native)
29
30 if(MSVC)
31 set_image_base(ntoskrnl 0x00400000)
32 add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
33 else()
34 if(GDB)
35 set_image_base(ntoskrnl 0x00800000)
36 else()
37 set_image_base(ntoskrnl 0x80800000)
38 endif()
39 endif()
40
41 target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
42
43 if(STACK_PROTECTOR)
44 target_link_libraries(ntoskrnl gcc_ssp)
45 elseif(RUNTIME_CHECKS)
46 target_link_libraries(ntoskrnl runtmchk)
47 endif()
48
49 add_importlibs(ntoskrnl hal kdcom bootvid)
50 add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTOSKRNL_SOURCE)
51 add_dependencies(ntoskrnl psdk bugcodes asm)
52 add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
53
54 if(BUILD_MP)
55 add_subdirectory(ntkrnlmp)
56 endif()
57
58 add_asm_files(ntdllsys_asm ntdll.S)
59 add_library(ntdllsys ${ntdllsys_asm})
60 set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
61 add_dependencies(ntdllsys asm)