2011-05-16 13:12:07 +00:00
|
|
|
|
2012-06-12 22:28:46 +00:00
|
|
|
PROJECT(NTOS)
|
|
|
|
|
2022-05-25 22:37:23 +00:00
|
|
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2021-06-17 12:48:52 +00:00
|
|
|
# Enable this again. CORE-17637
|
|
|
|
add_compile_options(-Wunused-result)
|
|
|
|
endif()
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
include(ntos.cmake)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
set(NTOSKRNL_SOURCE ${SOURCE})
|
|
|
|
set(NTOSKRNL_ASM_SOURCE ${ASM_SOURCE})
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
set(NTKRNLMP_SOURCE ${SOURCE})
|
|
|
|
set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
|
2020-12-31 16:56:39 +00:00
|
|
|
|
|
|
|
# Embed RTC libs
|
|
|
|
if (STACK_PROTECTOR)
|
|
|
|
target_sources(libntoskrnl PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
|
|
|
endif()
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
|
2013-01-08 20:33:08 +00:00
|
|
|
|
2021-08-01 21:23:10 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2020-11-09 08:41:48 +00:00
|
|
|
# Clang optimises strcmp calls to memcmp.
|
2020-12-31 16:56:39 +00:00
|
|
|
target_sources(libntoskrnl PRIVATE $<TARGET_OBJECTS:memcmp>)
|
2020-11-09 08:41:48 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-09 21:37:40 +00:00
|
|
|
list(APPEND PCH_SKIP_SOURCE
|
|
|
|
guid.c)
|
|
|
|
|
2012-04-13 21:35:00 +00:00
|
|
|
add_executable(ntoskrnl
|
2013-01-08 20:33:08 +00:00
|
|
|
${ntoskrnl_asm}
|
2014-02-10 17:12:41 +00:00
|
|
|
${NTOSKRNL_SOURCE}
|
2020-05-09 21:37:40 +00:00
|
|
|
${PCH_SKIP_SOURCE}
|
2014-02-10 17:12:41 +00:00
|
|
|
ntoskrnl.rc
|
2012-04-13 21:35:00 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
|
2021-02-24 10:47:18 +00:00
|
|
|
set_module_type(ntoskrnl kernel)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2020-05-27 20:28:00 +00:00
|
|
|
source_group(TREE ${REACTOS_SOURCE_DIR}/ntoskrnl PREFIX "Source Files" FILES ${NTOSKRNL_SOURCE})
|
|
|
|
|
2020-03-26 14:45:59 +00:00
|
|
|
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} arbiter cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2014-10-04 20:26:14 +00:00
|
|
|
if(STACK_PROTECTOR)
|
2020-12-31 16:56:39 +00:00
|
|
|
target_sources(ntoskrnl PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
2014-10-04 20:26:14 +00:00
|
|
|
endif()
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
add_importlibs(ntoskrnl hal kdcom bootvid)
|
2020-05-09 21:37:40 +00:00
|
|
|
add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h "${PCH_SKIP_SOURCE}")
|
2021-02-24 10:47:18 +00:00
|
|
|
add_dependencies(ntoskrnl psdk asm)
|
2011-05-16 13:12:07 +00:00
|
|
|
add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
|
2012-03-07 21:21:27 +00:00
|
|
|
|
2021-06-28 14:54:09 +00:00
|
|
|
if(BUILD_MP)
|
2014-02-10 17:12:41 +00:00
|
|
|
add_subdirectory(ntkrnlmp)
|
2012-04-13 16:16:39 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-01-08 20:33:08 +00:00
|
|
|
add_asm_files(ntdllsys_asm ntdll.S)
|
|
|
|
add_library(ntdllsys ${ntdllsys_asm})
|
|
|
|
set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
|
2020-05-27 20:28:00 +00:00
|
|
|
add_dependencies(ntdllsys asm)
|