Reactos
1
2spec2def(ucrtbase.dll ucrtbase.spec NO_DBG ADD_IMPORTLIB)
3
4# Hack to replace the old CRT include directory with the UCRT include directory
5get_property(INCLUDE_DIRS DIRECTORY . PROPERTY INCLUDE_DIRECTORIES)
6list(REMOVE_ITEM INCLUDE_DIRS "${REACTOS_SOURCE_DIR}/sdk/include/crt")
7set_property(DIRECTORY . PROPERTY INCLUDE_DIRECTORIES ${INCLUDE_DIRS})
8include_directories(${REACTOS_SOURCE_DIR}/sdk/include/ucrt)
9
10remove_definitions(-D_CRT_NON_CONFORMING_SWPRINTFS)
11
12add_compile_definitions(
13 _UCRT
14 _CORECRT_BUILD
15 CRTDLL
16)
17
18add_library(ucrtbase SHARED
19 printf.c
20 stubs.c
21 ucrtbase_stubs.c
22 ucrtbase.def
23)
24
25if(NOT MSVC)
26 target_compile_options(ucrtbase PRIVATE -Wno-builtin-declaration-mismatch)
27endif()
28
29if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
30 # Silence warnings in ucrtbase_stubs.c
31 target_compile_options(ucrtbase PRIVATE -Wno-incompatible-library-redeclaration)
32endif()
33
34set_entrypoint(ucrtbase __acrt_DllMain 12)
35
36target_link_libraries(ucrtbase
37 ucrt
38 msvcrt_shared
39 crtmath
40 vcruntime
41 chkstk
42 wine
43)
44
45# Implicitly link to vcstartup
46target_link_libraries(libucrtbase INTERFACE vcstartup)
47
48if(MSVC)
49 target_link_libraries(ucrtbase runtmchk)
50else()
51 # For __cxa_guard_acquire / __cxa_guard_release
52 target_link_libraries(ucrtbase libsupc++)
53endif()
54
55add_importlibs(ucrtbase kernel32 ntdll)
56
57add_cd_file(TARGET ucrtbase DESTINATION reactos/system32 FOR all)