2011-05-16 13:12:07 +00:00
|
|
|
|
2020-09-12 13:04:02 +00:00
|
|
|
add_subdirectory(nt_0600)
|
|
|
|
|
2012-03-07 21:21:27 +00:00
|
|
|
spec2def(ntdll.dll def/ntdll.spec ADD_IMPORTLIB)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2020-12-31 16:56:39 +00:00
|
|
|
# Embed RTC libs
|
|
|
|
if (STACK_PROTECTOR)
|
|
|
|
target_sources(libntdll PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
|
|
|
endif()
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
add_definitions(
|
|
|
|
-D__NTDLL__
|
|
|
|
-D_NTOSKRNL_
|
|
|
|
-DCRTDLL)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
BEFORE include
|
2016-04-20 12:36:25 +00:00
|
|
|
${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2023-05-27 12:29:19 +00:00
|
|
|
add_library(rtl_um OBJECT
|
|
|
|
rtl/libsupp.c
|
|
|
|
rtl/uilist.c
|
|
|
|
rtl/version.c)
|
2024-01-04 22:02:22 +00:00
|
|
|
target_link_libraries(rtl_um apisets ${PSEH_LIB})
|
2023-05-27 12:29:19 +00:00
|
|
|
add_dependencies(rtl_um psdk)
|
|
|
|
|
2024-09-14 14:35:15 +00:00
|
|
|
# On NT6+ this is used by advapi32
|
|
|
|
add_library(etwtrace etw/trace.c)
|
|
|
|
target_link_libraries(etwtrace ${PSEH_LIB})
|
|
|
|
add_dependencies(etwtrace psdk)
|
|
|
|
|
2011-05-16 13:12:07 +00:00
|
|
|
list(APPEND SOURCE
|
|
|
|
dbg/dbgui.c
|
2011-08-28 18:28:18 +00:00
|
|
|
ldr/ldrapi.c
|
|
|
|
ldr/ldrinit.c
|
|
|
|
ldr/ldrpe.c
|
|
|
|
ldr/ldrutils.c
|
2024-09-14 14:35:15 +00:00
|
|
|
ldr/verifier.c)
|
2011-08-28 18:28:18 +00:00
|
|
|
|
2012-08-27 18:58:27 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
2013-01-08 20:33:08 +00:00
|
|
|
list(APPEND ASM_SOURCE dispatch/i386/dispatch.S)
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "amd64")
|
2013-01-08 20:33:08 +00:00
|
|
|
list(APPEND ASM_SOURCE dispatch/amd64/dispatch.S)
|
2012-08-27 18:58:27 +00:00
|
|
|
elseif(ARCH STREQUAL "arm")
|
2013-01-08 20:33:08 +00:00
|
|
|
list(APPEND ASM_SOURCE dispatch/arm/stubs_asm.s)
|
2011-05-16 13:12:07 +00:00
|
|
|
else()
|
2011-08-28 18:28:18 +00:00
|
|
|
list(APPEND SOURCE dispatch/dispatch.c)
|
2013-01-08 20:33:08 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2013-01-08 20:33:08 +00:00
|
|
|
add_asm_files(ntdll_asm ${ASM_SOURCE})
|
2014-02-12 10:36:53 +00:00
|
|
|
|
2020-05-09 21:37:40 +00:00
|
|
|
list(APPEND PCH_SKIP_SOURCE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ntdll_stubs.c)
|
|
|
|
|
2019-03-20 13:19:48 +00:00
|
|
|
add_library(ntdll MODULE
|
2014-02-12 10:36:53 +00:00
|
|
|
${SOURCE}
|
|
|
|
${ntdll_asm}
|
2020-05-09 21:37:40 +00:00
|
|
|
${PCH_SKIP_SOURCE}
|
2014-02-12 10:36:53 +00:00
|
|
|
def/ntdll.rc
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ntdll.def)
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2015-11-04 18:06:16 +00:00
|
|
|
set_module_type(ntdll win32dll ENTRYPOINT 0)
|
2013-09-01 00:11:56 +00:00
|
|
|
#############################################
|
|
|
|
## HACK FOR MSVC COMPILATION WITH win32dll ##
|
|
|
|
set_subsystem(ntdll console)
|
|
|
|
################# END HACK #################
|
2011-05-16 13:12:07 +00:00
|
|
|
|
2024-09-14 14:35:15 +00:00
|
|
|
target_link_libraries(ntdll etwtrace csrlib rtl rtl_um rtl_vista ntdllsys libcntpr uuid ${PSEH_LIB})
|
2023-12-18 17:35:30 +00:00
|
|
|
if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600)
|
|
|
|
target_link_libraries(ntdll cryptlib)
|
|
|
|
endif()
|
2020-12-31 16:56:39 +00:00
|
|
|
|
|
|
|
if (STACK_PROTECTOR)
|
|
|
|
target_sources(ntdll PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
|
|
|
endif()
|
|
|
|
|
2020-05-09 21:37:40 +00:00
|
|
|
add_pch(ntdll include/ntdll.h "${PCH_SKIP_SOURCE}")
|
2011-05-16 13:12:07 +00:00
|
|
|
add_dependencies(ntdll ntstatus asm)
|
|
|
|
add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all)
|
2024-08-24 10:20:11 +00:00
|
|
|
|
|
|
|
# Newer VS versions link to _ftol2 / _ftoul2_legacy
|
|
|
|
if(MSVC AND ARCH STREQUAL "i386")
|
|
|
|
target_link_libraries(libntdll ftol2)
|
|
|
|
endif()
|