2011-05-16 13:12:07 +00:00
|
|
|
|
2016-04-20 12:36:25 +00:00
|
|
|
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/crt/include)
|
2020-11-02 09:51:08 +00:00
|
|
|
spec2def(msvcrt.dll msvcrt.spec ADD_IMPORTLIB)
|
2020-10-22 14:29:40 +00:00
|
|
|
|
2020-11-02 09:51:08 +00:00
|
|
|
# Let consumers of msvcrt have the right defines
|
2020-10-22 14:29:40 +00:00
|
|
|
target_compile_definitions(libmsvcrt INTERFACE _DLL __USE_CRTIMP)
|
2020-11-02 09:51:08 +00:00
|
|
|
# Embed msvcrtex into libmsvcrt
|
|
|
|
target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:msvcrtex>)
|
|
|
|
|
2020-12-31 16:56:39 +00:00
|
|
|
# Embed RTC libs
|
|
|
|
if (STACK_PROTECTOR)
|
|
|
|
target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:gcc_ssp_msvcrt>)
|
|
|
|
target_link_libraries(libmsvcrt INTERFACE libkernel32) # For OutputDebugStringA
|
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
|
|
|
add_definitions(
|
|
|
|
-DUSE_MSVCRT_PREFIX
|
|
|
|
-D_MSVCRT_
|
|
|
|
-D_MSVCRT_LIB_
|
|
|
|
-D_MT
|
|
|
|
-D_CTYPE_DISABLE_MACROS
|
|
|
|
-D_NO_INLINING
|
|
|
|
-DCRTDLL
|
|
|
|
-D__MINGW_IMPORT="")
|
|
|
|
|
|
|
|
list(APPEND SOURCE
|
|
|
|
dllmain.c
|
|
|
|
stubs.c
|
|
|
|
msvcrt.rc
|
2014-02-02 15:47:52 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/msvcrt_stubs.c
|
2011-05-16 13:12:07 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/msvcrt.def)
|
|
|
|
|
2019-03-20 13:19:48 +00:00
|
|
|
add_library(msvcrt MODULE ${SOURCE})
|
2011-09-03 18:26:19 +00:00
|
|
|
set_module_type(msvcrt win32dll ENTRYPOINT DllMain 12)
|
2011-05-16 13:12:07 +00:00
|
|
|
add_dependencies(msvcrt psdk)
|
2023-08-05 12:28:45 +00:00
|
|
|
target_link_libraries(msvcrt crt cpprt wine ${PSEH_LIB})
|
2011-07-23 20:23:48 +00:00
|
|
|
|
2011-08-23 08:13:33 +00:00
|
|
|
if(MSVC)
|
2011-08-28 18:28:18 +00:00
|
|
|
# export of deleting destructor "name"
|
2020-10-22 14:29:40 +00:00
|
|
|
target_link_options(msvcrt PRIVATE "/ignore:4102")
|
2020-11-02 09:51:08 +00:00
|
|
|
set_property(TARGET libmsvcrt APPEND PROPERTY STATIC_LIBRARY_OPTIONS "/ignore:4102")
|
|
|
|
if(ARCH STREQUAL "i386")
|
|
|
|
target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:ftol2_sse>)
|
|
|
|
endif()
|
2011-07-23 20:23:48 +00:00
|
|
|
endif()
|
2011-05-16 13:12:07 +00:00
|
|
|
|
|
|
|
add_importlibs(msvcrt kernel32 ntdll)
|
|
|
|
add_cd_file(TARGET msvcrt DESTINATION reactos/system32 FOR all)
|