mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:22:57 +00:00
[CMAKE/MSVC]
* Use the runtime checks globally in ReactOS now, not just for user mode modules. * We no longer need the MS support lib, as Timo kindly implemented one for ReactOS. * Rename the lib to runtmchk. [PSEH][CRT] * Remove some constrictions to seh.s source files, we no longer need them. [KERNEL32] * We no longer need to explicitly link to the runtime checks lib. [FREELDR][KEYBOARD][NTOS][SETUPLDR] * Link to the runtime checks lib when this mode is enabled. CORE-8626 svn path=/trunk/; revision=64807
This commit is contained in:
parent
ee8be36736
commit
df43f0f0a0
9 changed files with 23 additions and 41 deletions
|
@ -213,6 +213,9 @@ target_link_libraries(freeldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr)
|
||||||
if(STACK_PROTECTOR)
|
if(STACK_PROTECTOR)
|
||||||
target_link_libraries(freeldr_pe gcc_ssp)
|
target_link_libraries(freeldr_pe gcc_ssp)
|
||||||
target_link_libraries(freeldr_pe_dbg gcc_ssp)
|
target_link_libraries(freeldr_pe_dbg gcc_ssp)
|
||||||
|
elseif(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(freeldr_pe runtmchk)
|
||||||
|
target_link_libraries(freeldr_pe_dbg runtmchk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(freeldr_pe asm)
|
add_dependencies(freeldr_pe asm)
|
||||||
|
@ -273,6 +276,9 @@ target_link_libraries(setupldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr
|
||||||
if(STACK_PROTECTOR)
|
if(STACK_PROTECTOR)
|
||||||
target_link_libraries(setupldr_pe gcc_ssp)
|
target_link_libraries(setupldr_pe gcc_ssp)
|
||||||
target_link_libraries(setupldr_pe_dbg gcc_ssp)
|
target_link_libraries(setupldr_pe_dbg gcc_ssp)
|
||||||
|
elseif(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(setupldr_pe runtmchk)
|
||||||
|
target_link_libraries(setupldr_pe_dbg runtmchk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(setupldr_pe asm)
|
add_dependencies(setupldr_pe asm)
|
||||||
|
|
|
@ -502,14 +502,6 @@ function(add_importlibs _module)
|
||||||
if("${LIB}" MATCHES "msvcrt")
|
if("${LIB}" MATCHES "msvcrt")
|
||||||
add_target_compile_definitions(${_module} _DLL __USE_CRTIMP)
|
add_target_compile_definitions(${_module} _DLL __USE_CRTIMP)
|
||||||
target_link_libraries(${_module} msvcrtex)
|
target_link_libraries(${_module} msvcrtex)
|
||||||
if(MSVC)
|
|
||||||
if(RUNTIME_CHECKS)
|
|
||||||
if(NOT ${_module} STREQUAL "kernel32")
|
|
||||||
add_target_compile_flags(${_module} "/RTC1")
|
|
||||||
target_link_libraries(${_module} RunTmChk.lib)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(${_module} lib${LIB})
|
target_link_libraries(${_module} lib${LIB})
|
||||||
add_dependencies(${_module} lib${LIB})
|
add_dependencies(${_module} lib${LIB})
|
||||||
|
|
|
@ -88,6 +88,7 @@ endif()
|
||||||
|
|
||||||
if(RUNTIME_CHECKS)
|
if(RUNTIME_CHECKS)
|
||||||
add_definitions(-D__RUNTIME_CHECKS__)
|
add_definitions(-D__RUNTIME_CHECKS__)
|
||||||
|
add_compile_flags("/RTC1")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE")
|
||||||
|
@ -232,6 +233,11 @@ function(set_module_type_toolchain MODULE TYPE)
|
||||||
elseif(${TYPE} STREQUAL "wdmdriver")
|
elseif(${TYPE} STREQUAL "wdmdriver")
|
||||||
add_target_link_flags(${MODULE} "/DRIVER:WDM")
|
add_target_link_flags(${MODULE} "/DRIVER:WDM")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(${MODULE} runtmchk)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Define those for having real libraries
|
# Define those for having real libraries
|
||||||
|
|
|
@ -102,6 +102,10 @@ foreach(_keyboard_layout ${_keyboard_layouts})
|
||||||
add_target_link_flags(${_keyboard_layout} "-Wl,-T,${CMAKE_SOURCE_DIR}/kbdlayout.lds")
|
add_target_link_flags(${_keyboard_layout} "-Wl,-T,${CMAKE_SOURCE_DIR}/kbdlayout.lds")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(${_keyboard_layout} runtmchk)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_dependencies(${_keyboard_layout} psdk)
|
add_dependencies(${_keyboard_layout} psdk)
|
||||||
add_cd_file(TARGET ${_keyboard_layout} DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET ${_keyboard_layout} DESTINATION reactos/system32 FOR all)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -106,11 +106,6 @@ set_subsystem(kernel32 console)
|
||||||
################# END HACK #################
|
################# END HACK #################
|
||||||
|
|
||||||
target_link_libraries(kernel32 wine chkstk ${PSEH_LIB})
|
target_link_libraries(kernel32 wine chkstk ${PSEH_LIB})
|
||||||
|
|
||||||
if(RUNTIME_CHECKS)
|
|
||||||
target_link_libraries(kernel32 RunTmChk.lib)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_importlibs(kernel32 ntdll)
|
add_importlibs(kernel32 ntdll)
|
||||||
add_pch(kernel32 k32.h SOURCE)
|
add_pch(kernel32 k32.h SOURCE)
|
||||||
add_dependencies(kernel32 psdk errcodes asm)
|
add_dependencies(kernel32 psdk errcodes asm)
|
||||||
|
|
|
@ -22,12 +22,9 @@ EXTERN _RtlUnwind@16:PROC
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
#ifndef __RUNTIME_CHECKS__
|
|
||||||
PUBLIC __global_unwind2
|
PUBLIC __global_unwind2
|
||||||
PUBLIC __local_unwind2
|
PUBLIC __local_unwind2
|
||||||
PUBLIC __abnormal_termination
|
PUBLIC __abnormal_termination
|
||||||
#endif
|
|
||||||
|
|
||||||
PUBLIC __except_handler2
|
PUBLIC __except_handler2
|
||||||
PUBLIC __except_handler3
|
PUBLIC __except_handler3
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,8 @@ EXTERN _RtlUnwind@16:PROC
|
||||||
PUBLIC __global_unwind2
|
PUBLIC __global_unwind2
|
||||||
PUBLIC __local_unwind2
|
PUBLIC __local_unwind2
|
||||||
PUBLIC __abnormal_termination
|
PUBLIC __abnormal_termination
|
||||||
|
|
||||||
#if !defined(__RUNTIME_CHECKS__) || (defined(__RUNTIME_CHECKS__) && !defined(_LIBCNT_))
|
|
||||||
PUBLIC __except_handler2
|
PUBLIC __except_handler2
|
||||||
PUBLIC __except_handler3
|
PUBLIC __except_handler3
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ set(NTKRNLMP_SOURCE ${SOURCE})
|
||||||
set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
|
set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE})
|
||||||
|
|
||||||
spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
|
spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB)
|
||||||
|
|
||||||
add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
|
add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE})
|
||||||
|
|
||||||
add_executable(ntoskrnl
|
add_executable(ntoskrnl
|
||||||
|
@ -37,19 +36,12 @@ else()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(ntoskrnl
|
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
|
||||||
cportlib
|
|
||||||
csq
|
|
||||||
${PSEH_LIB}
|
|
||||||
cmlib
|
|
||||||
rtl
|
|
||||||
${ROSSYM_LIB}
|
|
||||||
libcntpr
|
|
||||||
wdmguid
|
|
||||||
ioevent)
|
|
||||||
|
|
||||||
if(STACK_PROTECTOR)
|
if(STACK_PROTECTOR)
|
||||||
target_link_libraries(ntoskrnl gcc_ssp)
|
target_link_libraries(ntoskrnl gcc_ssp)
|
||||||
|
elseif(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(ntoskrnl runtmchk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_importlibs(ntoskrnl hal kdcom bootvid)
|
add_importlibs(ntoskrnl hal kdcom bootvid)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
include(../ntos.cmake)
|
include(../ntos.cmake)
|
||||||
|
|
||||||
spec2def(ntkrnlmp.exe ../ntoskrnl.spec)
|
spec2def(ntkrnlmp.exe ../ntoskrnl.spec)
|
||||||
|
@ -32,19 +33,11 @@ endif()
|
||||||
|
|
||||||
if(STACK_PROTECTOR)
|
if(STACK_PROTECTOR)
|
||||||
target_link_libraries(ntkrnlmp gcc_ssp)
|
target_link_libraries(ntkrnlmp gcc_ssp)
|
||||||
|
elseif(RUNTIME_CHECKS)
|
||||||
|
target_link_libraries(ntkrnlmp runtmchk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(ntkrnlmp
|
target_link_libraries(ntkrnlmp cportlib csq ${PSEH_LIB} cmlib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)
|
||||||
cportlib
|
|
||||||
csq
|
|
||||||
${PSEH_LIB}
|
|
||||||
cmlib
|
|
||||||
rtl
|
|
||||||
${ROSSYM_LIB}
|
|
||||||
libcntpr
|
|
||||||
wdmguid
|
|
||||||
ioevent)
|
|
||||||
|
|
||||||
add_importlibs(ntkrnlmp hal kdcom bootvid)
|
add_importlibs(ntkrnlmp hal kdcom bootvid)
|
||||||
add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE)
|
add_pch(ntkrnlmp ${REACTOS_SOURCE_DIR}/ntoskrnl/include/ntoskrnl.h NTKRNLMP_SOURCE)
|
||||||
add_dependencies(ntkrnlmp psdk bugcodes asm)
|
add_dependencies(ntkrnlmp psdk bugcodes asm)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue