128933e8d0855666ef4a12711572009d7f93c1d9
[reactos.git] / rostests / kmtests / CMakeLists.txt
1
2 include_directories(include)
3
4 #
5 # subdirectories containing special-purpose drivers
6 #
7 add_subdirectory(example)
8 add_subdirectory(kernel32)
9 add_subdirectory(ntos_io)
10 add_subdirectory(tcpip)
11
12 list(APPEND COMMON_SOURCE
13 example/GuardedMemory.c
14 rtl/RtlAvlTree.c
15 rtl/RtlException.c
16 rtl/RtlIntSafe.c
17 rtl/RtlMemory.c
18 rtl/RtlRegistry.c
19 rtl/RtlSplayTree.c
20 rtl/RtlUnicodeString.c)
21
22 #
23 # kmtest_drv.sys driver
24 #
25 list(APPEND KMTEST_DRV_SOURCE
26 kmtest_drv/guid.c
27 kmtest_drv/kmtest_drv.c
28 kmtest_drv/testlist.c
29
30 example/Example.c
31 example/KernelType.c
32 npfs/NpfsConnect.c
33 npfs/NpfsCreate.c
34 npfs/NpfsFileInfo.c
35 npfs/NpfsHelpers.c
36 npfs/NpfsReadWrite.c
37 npfs/NpfsVolumeInfo.c
38 ntos_ex/ExCallback.c
39 ntos_ex/ExDoubleList.c
40 ntos_ex/ExFastMutex.c
41 ntos_ex/ExHardError.c
42 ntos_ex/ExInterlocked.c
43 ntos_ex/ExPools.c
44 ntos_ex/ExResource.c
45 ntos_ex/ExSequencedList.c
46 ntos_ex/ExSingleList.c
47 ntos_ex/ExTimer.c
48 ntos_fsrtl/FsRtlExpression.c
49 ntos_fsrtl/FsRtlMcb.c
50 ntos_fsrtl/FsRtlTunnel.c
51 ntos_io/IoCreateFile.c
52 ntos_io/IoDeviceInterface.c
53 ntos_io/IoEvent.c
54 ntos_io/IoInterrupt.c
55 ntos_io/IoIrp.c
56 ntos_io/IoMdl.c
57 ntos_ke/KeApc.c
58 ntos_ke/KeDevQueue.c
59 ntos_ke/KeDpc.c
60 ntos_ke/KeEvent.c
61 ntos_ke/KeGuardedMutex.c
62 ntos_ke/KeIrql.c
63 ntos_ke/KeMutex.c
64 ntos_ke/KeProcessor.c
65 ntos_ke/KeSpinLock.c
66 ntos_ke/KeTimer.c
67 ntos_mm/MmMdl.c
68 ntos_mm/MmSection.c
69 ntos_mm/ZwAllocateVirtualMemory.c
70 ntos_mm/ZwCreateSection.c
71 ntos_mm/ZwMapViewOfSection.c
72 ntos_ob/ObReference.c
73 ntos_ob/ObType.c
74 ntos_ob/ObTypes.c
75 ntos_ps/PsNotify.c
76 ntos_se/SeHelpers.c
77 ntos_se/SeInheritance.c
78 ntos_se/SeQueryInfoToken.c
79 ${COMMON_SOURCE}
80
81 kmtest_drv/kmtest_drv.rc)
82
83 add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE})
84 set_module_type(kmtest_drv kernelmodedriver)
85 target_link_libraries(kmtest_drv kmtest_printf chkstk ${PSEH_LIB})
86 add_importlibs(kmtest_drv ntoskrnl hal)
87 add_dependencies(kmtest_drv bugcodes xdk)
88 add_target_compile_definitions(kmtest_drv KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1)
89 #add_pch(kmtest_drv include/kmt_test.h)
90 add_cd_file(TARGET kmtest_drv DESTINATION reactos/bin FOR all)
91
92 add_library(kmtest_printf
93 kmtest_drv/printf_stubs.c
94 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/string/strnlen.c
95 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/string/wcsnlen.c
96 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/printf/streamout.c)
97 add_target_compile_definitions(kmtest_printf _LIBCNT_ _USER32_WSPRINTF wctomb=KmtWcToMb)
98 add_target_include_directories(kmtest_printf ${REACTOS_SOURCE_DIR}/lib/sdk/crt/include)
99
100 #
101 # kmtest.exe loader application
102 #
103
104 list(APPEND KMTEST_SOURCE
105 kmtest/kmtest.c
106 kmtest/service.c
107 kmtest/support.c
108 kmtest/testlist.c
109
110 example/Example_user.c
111 kernel32/FindFile_user.c
112 ntos_io/IoDeviceObject_user.c
113 ntos_io/IoReadWrite_user.c
114 tcpip/TcpIp_user.c
115 ${COMMON_SOURCE}
116
117 kmtest/kmtest.rc)
118
119 add_executable(kmtest ${KMTEST_SOURCE})
120 set_module_type(kmtest win32cui)
121 target_link_libraries(kmtest ${PSEH_LIB})
122 add_importlibs(kmtest advapi32 ws2_32 msvcrt kernel32 ntdll)
123 add_target_compile_definitions(kmtest KMT_USER_MODE)
124 #add_pch(kmtest include/kmt_test.h)
125 set_target_properties(kmtest PROPERTIES OUTPUT_NAME "kmtest_")
126 add_cd_file(TARGET kmtest DESTINATION reactos/bin FOR all)
127
128 #
129 # Group targets
130 #
131 add_custom_target(kmtest_drivers)
132 add_dependencies(kmtest_drivers
133 kmtest_drv
134 example_drv
135 iodeviceobject_drv
136 iohelper_drv
137 ioreadwrite_drv
138 tcpip_drv)
139
140 add_custom_target(kmtest_all)
141 add_dependencies(kmtest_all kmtest_drivers kmtest)