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-10-22 14:29:40 +00:00
|
|
|
spec2def(msvcrt.dll msvcrt.spec)
|
|
|
|
|
|
|
|
# The msvcrt <-> msvcrtex trick
|
|
|
|
generate_import_lib(libmsvcrt_real msvcrt.dll msvcrt.spec)
|
|
|
|
add_library(libmsvcrt INTERFACE)
|
|
|
|
target_compile_definitions(libmsvcrt INTERFACE _DLL __USE_CRTIMP)
|
|
|
|
# if the linked module is one of win32gui;win32cui;win32dll;win32ocx;cpl link it with msvcrtex, which itself is linked to libmsvcrt_real
|
|
|
|
# Otherwise, just link to libmsvcrt_real
|
|
|
|
target_link_libraries(libmsvcrt INTERFACE "$<IF:$<IN_LIST:$<TARGET_PROPERTY:REACTOS_MODULE_TYPE>,win32gui;win32cui;win32dll;win32ocx;cpl>,msvcrtex,libmsvcrt_real>")
|
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)
|
2011-08-28 18:28:18 +00:00
|
|
|
target_link_libraries(msvcrt crt 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")
|
|
|
|
set_property(TARGET libmsvcrt_real APPEND PROPERTY STATIC_LIBRARY_OPTIONS "/ignore:4102")
|
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)
|