xref: /reactos/boot/rtl/blrtl.cmake (revision f155b937)
1
2add_definitions(
3    -DNO_RTL_INLINES
4    -D_BLDR_
5    -D_NTSYSTEM_)
6
7set(NTOS_RTL_SOURCE_DIR "${REACTOS_SOURCE_DIR}/sdk/lib/rtl")
8include_directories(${NTOS_RTL_SOURCE_DIR})
9
10if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
11    # Enable this again. CORE-17637
12    add_compile_options(-Wunused-result)
13endif()
14
15list(APPEND SOURCE
16    # ${NTOS_RTL_SOURCE_DIR}/assert.c   ## Requires a local implementation.
17    ${NTOS_RTL_SOURCE_DIR}/bitmap.c
18    # ${NTOS_RTL_SOURCE_DIR}/bootdata.c ## Requires a local implementation.
19    ${NTOS_RTL_SOURCE_DIR}/compress.c
20    ${NTOS_RTL_SOURCE_DIR}/crc32.c
21    # ${NTOS_RTL_SOURCE_DIR}/debug.c    ## Requires a local implementation.
22    ${NTOS_RTL_SOURCE_DIR}/image.c
23    ${NTOS_RTL_SOURCE_DIR}/largeint.c
24    ## message.c
25    # ${NTOS_RTL_SOURCE_DIR}/nls.c      ## Requires a local implementation.
26    nlsboot.c
27    ${NTOS_RTL_SOURCE_DIR}/random.c
28    ## res.c    ## Optional? Needs SEH
29    # ${NTOS_RTL_SOURCE_DIR}/time.c     ## Optional
30    ${NTOS_RTL_SOURCE_DIR}/unicode.c
31    ${NTOS_RTL_SOURCE_DIR}/rtl.h)
32
33if(ARCH STREQUAL "i386")
34    list(APPEND ASM_SOURCE
35        ${NTOS_RTL_SOURCE_DIR}/i386/debug_asm.S
36        ${NTOS_RTL_SOURCE_DIR}/i386/rtlmem.s
37        ${NTOS_RTL_SOURCE_DIR}/i386/rtlswap.S
38        ## ${NTOS_RTL_SOURCE_DIR}/i386/res_asm.s
39        )
40elseif(ARCH STREQUAL "amd64")
41    list(APPEND ASM_SOURCE
42        ${NTOS_RTL_SOURCE_DIR}/amd64/debug_asm.S
43        ## ${NTOS_RTL_SOURCE_DIR}/amd64/rtlmem.S
44        )
45    list(APPEND SOURCE
46        ${NTOS_RTL_SOURCE_DIR}/bitmap64.c
47        ${NTOS_RTL_SOURCE_DIR}/byteswap.c
48        ${NTOS_RTL_SOURCE_DIR}/mem.c)
49elseif(ARCH STREQUAL "arm")
50    list(APPEND ASM_SOURCE
51        ${NTOS_RTL_SOURCE_DIR}/arm/debug_asm.S)
52    list(APPEND SOURCE
53        ${NTOS_RTL_SOURCE_DIR}/byteswap.c
54        ${NTOS_RTL_SOURCE_DIR}/mem.c)
55endif()
56
57add_asm_files(blrtl_asm ${ASM_SOURCE})
58add_library(blrtl ${SOURCE} ${blrtl_asm})
59add_pch(blrtl ${NTOS_RTL_SOURCE_DIR}/rtl.h SOURCE)
60add_dependencies(blrtl psdk asm)
61