https://git.reactos.org/?p=reactos.git;a=commitdiff;h=173cdcae8fbe8194d2393…
commit 173cdcae8fbe8194d23931aae034efc0b8f7f534
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Wed Feb 24 11:47:18 2021 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Tue Mar 23 11:18:43 2021 +0100
[CMAKE] Use the "kernel" module type for ntoskrnl and ntkrnlmp
---
ntoskrnl/CMakeLists.txt | 34 +++++++---------------------------
ntoskrnl/ntkrnlmp/CMakeLists.txt | 23 ++---------------------
2 files changed, 9 insertions(+), 48 deletions(-)
diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt
index 8048520ec90..2efd6f12833 100644
--- a/ntoskrnl/CMakeLists.txt
+++ b/ntoskrnl/CMakeLists.txt
@@ -32,46 +32,26 @@ add_executable(ntoskrnl
${PCH_SKIP_SOURCE}
ntoskrnl.rc
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
-set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
-set_target_properties(ntoskrnl PROPERTIES DEFINE_SYMBOL "")
+set_module_type(ntoskrnl kernel)
source_group(TREE ${REACTOS_SOURCE_DIR}/ntoskrnl PREFIX "Source Files" FILES
${NTOSKRNL_SOURCE})
-if(ARCH STREQUAL "i386")
- set_entrypoint(ntoskrnl KiSystemStartup 4)
-else()
- set_entrypoint(ntoskrnl KiSystemStartup)
-endif()
-set_subsystem(ntoskrnl native)
-
-if(MSVC)
- set_image_base(ntoskrnl 0x00400000)
- add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from
bugcheck code
- add_target_link_flags(ntoskrnl "/SECTION:INIT,ERWD")
-else()
- if(GDB AND NOT CLANG)
- # Completely disable optimizations when debugging the kernel
- # Not for CLang, which fails as following in _SEH2_EXCEPT macro:
- # error: inline assembly requires more registers than available
- target_compile_options(ntoskrnl PRIVATE -O0)
- set_image_base(ntoskrnl 0x00800000)
- else()
- set_image_base(ntoskrnl 0x80800000)
- endif()
- add_linker_script(ntoskrnl ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds)
+if(GDB AND NOT CLANG)
+ # Completely disable optimizations when debugging the kernel
+ # Not for CLang, which fails as following in _SEH2_EXCEPT macro:
+ # error: inline assembly requires more registers than available
+ target_compile_options(ntoskrnl PRIVATE -O0)
endif()
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} arbiter cmlib ntlsalib rtl
${ROSSYM_LIB} libcntpr wdmguid ioevent)
if(STACK_PROTECTOR)
target_sources(ntoskrnl PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
-elseif(RUNTIME_CHECKS)
- target_link_libraries(ntoskrnl runtmchk)
endif()
add_importlibs(ntoskrnl hal kdcom bootvid)
add_pch(ntoskrnl ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h
"${PCH_SKIP_SOURCE}")
-add_dependencies(ntoskrnl psdk bugcodes asm)
+add_dependencies(ntoskrnl psdk asm)
add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all)
if(BUILD_MP)
diff --git a/ntoskrnl/ntkrnlmp/CMakeLists.txt b/ntoskrnl/ntkrnlmp/CMakeLists.txt
index 393fee96409..a56ec6ce8e3 100644
--- a/ntoskrnl/ntkrnlmp/CMakeLists.txt
+++ b/ntoskrnl/ntkrnlmp/CMakeLists.txt
@@ -19,35 +19,16 @@ add_executable(ntkrnlmp
${NTKRNLMP_PCH_SKIP_SOURCE}
${REACTOS_SOURCE_DIR}/ntoskrnl/ntoskrnl.rc
${CMAKE_CURRENT_BINARY_DIR}/ntkrnlmp.def)
-set_property(TARGET ntkrnlmp PROPERTY ENABLE_EXPORTS TRUE)
-
+set_module_type(ntkrnlmp kernel)
target_compile_definitions(ntkrnlmp PRIVATE CONFIG_SMP)
-if(ARCH STREQUAL "i386")
- set_entrypoint(ntkrnlmp KiSystemStartup 4)
-else()
- set_entrypoint(ntkrnlmp KiSystemStartup)
-endif()
-set_subsystem(ntkrnlmp native)
-
-if(MSVC)
- set_image_base(ntkrnlmp 0x00400000)
- add_target_link_flags(ntkrnlmp "/SECTION:.rsrc,!DP") #Accessed from
bugcheck code
-else()
- set_image_base(ntkrnlmp 0x80800000)
-endif()
-
# dynamic analysis switches
if(STACK_PROTECTOR)
target_sources(ntkrnlmp PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
endif()
-if(RUNTIME_CHECKS)
- target_link_libraries(ntkrnlmp runtmchk)
-endif()
-
target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} arbiter cmlib ntlsalib rtl
${ROSSYM_LIB} libcntpr wdmguid ioevent)
add_importlibs(ntkrnlmp hal kdcom bootvid)
add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h
"${NTKRNLMP_PCH_SKIP_SOURCE}")
-add_dependencies(ntkrnlmp psdk bugcodes asm)
+add_dependencies(ntkrnlmp psdk asm)
add_cd_file(TARGET ntkrnlmp DESTINATION reactos/system32 NO_CAB FOR all)