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