1
2
3list(APPEND SOURCE
4    RtlIntSafe.c
5)
6
7if(ARCH STREQUAL "i386")
8    list(APPEND SOURCE
9        i386/RtlCaptureContext.c
10    )
11elseif(ARCH STREQUAL "amd64")
12    list(APPEND ASM_SOURCE
13        amd64/RtlCaptureContext-asm.s
14    )
15    list(APPEND SOURCE
16        amd64/RtlCaptureContext.c
17    )
18elseif(ARCH STREQUAL "arm")
19    list(APPEND SOURCE
20        # To be filled
21    )
22endif()
23
24add_asm_files(rtl_test_asm ${ASM_SOURCE})
25
26add_library(rtl_test_lib
27    ${SOURCE}
28    ${rtl_test_asm}
29)
30
31target_compile_definitions(rtl_test_lib PRIVATE _RTL_TEST _NTSYSTEM_)
32
33add_dependencies(rtl_test_lib asm)
34
35if(NOT MSVC)
36    set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
37
38    # Avoid "universal character names are only valid in C++ and C99" error.
39    set_property(TARGET rtl_test_lib PROPERTY C_STANDARD 99)
40endif()
41
42# RTL tests with static linkage (called unittest, so it won't run in rosautotest)
43add_executable(rtl_unittest
44    testlist.c
45    ldrstubs.c)
46target_compile_definitions(rtl_unittest PRIVATE _RTL_TEST _NTSYSTEM_)
47target_link_libraries(rtl_unittest rtl_test_lib rtl rtl_um rtl_vista wine uuid ${PSEH_LIB})
48set_module_type(rtl_unittest win32cui)
49add_importlibs(rtl_unittest msvcrt advapi32 kernel32 ntdll)
50target_compile_definitions(rtl_unittest PRIVATE KMT_USER_MODE NTDDI_VERSION=NTDDI_WS03SP1)
51
52add_rostests_file(TARGET rtl_unittest)
53
54if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
55    target_compile_options(rtl_unittest PRIVATE -Wno-format)
56endif()
57