1 2include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/crt/include) 3spec2def(msvcrt.dll msvcrt.spec ADD_IMPORTLIB) 4 5# Let consumers of msvcrt have the right defines 6target_compile_definitions(libmsvcrt INTERFACE _DLL __USE_CRTIMP) 7# Embed msvcrtex into libmsvcrt 8target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:msvcrtex>) 9 10# Embed RTC libs 11if (STACK_PROTECTOR) 12 target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:gcc_ssp_msvcrt>) 13 target_link_libraries(libmsvcrt INTERFACE libkernel32) # For OutputDebugStringA 14endif() 15 16add_definitions( 17 -DUSE_MSVCRT_PREFIX 18 -D_MSVCRT_ 19 -D_MSVCRT_LIB_ 20 -D_MT 21 -D_CTYPE_DISABLE_MACROS 22 -D_NO_INLINING 23 -DCRTDLL 24 -D__MINGW_IMPORT="") 25 26list(APPEND SOURCE 27 dllmain.c 28 stubs.c 29 msvcrt.rc 30 ${CMAKE_CURRENT_BINARY_DIR}/msvcrt_stubs.c 31 ${CMAKE_CURRENT_BINARY_DIR}/msvcrt.def) 32 33add_library(msvcrt MODULE ${SOURCE}) 34set_module_type(msvcrt win32dll ENTRYPOINT DllMain 12) 35add_dependencies(msvcrt psdk) 36target_link_libraries(msvcrt crt wine ${PSEH_LIB}) 37 38if(MSVC) 39 # export of deleting destructor "name" 40 target_link_options(msvcrt PRIVATE "/ignore:4102") 41 set_property(TARGET libmsvcrt APPEND PROPERTY STATIC_LIBRARY_OPTIONS "/ignore:4102") 42 if(ARCH STREQUAL "i386") 43 target_sources(libmsvcrt PRIVATE $<TARGET_OBJECTS:ftol2_sse>) 44 endif() 45endif() 46 47add_importlibs(msvcrt kernel32 ntdll) 48add_cd_file(TARGET msvcrt DESTINATION reactos/system32 FOR all) 49