ae4148cf33b1031ee637cdecaf92143466919697
[reactos.git] / ntoskrnl / CMakeLists.txt
1
2 include_directories(
3 ${REACTOS_SOURCE_DIR}
4 ${REACTOS_SOURCE_DIR}/lib/cmlib
5 include
6 ${CMAKE_CURRENT_BINARY_DIR}/include
7 ${CMAKE_CURRENT_BINARY_DIR}/include/internal
8 ${REACTOS_SOURCE_DIR}/include/reactos/drivers)
9
10 add_definitions(
11 -D__NTOSKRNL__
12 -D_NTOSKRNL_
13 -D_NTSYSTEM_
14 -D_IN_KERNEL_
15 -DNTDDI_VERSION=0x05020400)
16
17 set_rc_compiler()
18
19 list(APPEND SOURCE
20 cc/cacheman.c
21 cc/copy.c
22 cc/fs.c
23 cc/mdl.c
24 cc/pin.c
25 cc/view.c
26 config/cmalloc.c
27 config/cmapi.c
28 config/cmboot.c
29 config/cmcheck.c
30 config/cmconfig.c
31 config/cmcontrl.c
32 config/cmdata.c
33 config/cmdelay.c
34 config/cmhook.c
35 config/cmhvlist.c
36 config/cmindex.c
37 config/cminit.c
38 config/cmkcbncb.c
39 config/cmkeydel.c
40 config/cmlazy.c
41 config/cmmapvw.c
42 config/cmname.c
43 config/cmnotify.c
44 config/cmparse.c
45 config/cmquota.c
46 config/cmse.c
47 config/cmsecach.c
48 config/cmsysini.c
49 config/cmvalche.c
50 config/cmvalue.c
51 config/cmwraprs.c
52 config/ntapi.c
53 dbgk/dbgkobj.c
54 dbgk/dbgkutil.c
55 ex/atom.c
56 ex/callback.c
57 ex/dbgctrl.c
58 ex/efi.c
59 ex/event.c
60 ex/evtpair.c
61 ex/exintrin.c
62 ex/fastinterlck.c
63 ex/fmutex.c
64 ex/handle.c
65 ex/harderr.c
66 ex/hdlsterm.c
67 ex/init.c
68 ex/keyedevt.c
69 ex/locale.c
70 ex/lookas.c
71 ex/mutant.c
72 ex/profile.c
73 ex/pushlock.c
74 ex/resource.c
75 ex/rundown.c
76 ex/sem.c
77 ex/shutdown.c
78 ex/sysinfo.c
79 ex/time.c
80 ex/timer.c
81 ex/uuid.c
82 ex/win32k.c
83 ex/work.c
84 ex/xipdisp.c
85 ex/zone.c
86 fsrtl/dbcsname.c
87 fsrtl/fastio.c
88 fsrtl/faulttol.c
89 fsrtl/filelock.c
90 fsrtl/filter.c
91 fsrtl/filtrctx.c
92 fsrtl/fsfilter.c
93 fsrtl/fsrtlpc.c
94 fsrtl/largemcb.c
95 fsrtl/name.c
96 fsrtl/notify.c
97 fsrtl/oplock.c
98 fsrtl/pnp.c
99 fsrtl/stackovf.c
100 fsrtl/tunnel.c
101 fsrtl/unc.c
102 fstub/disksup.c
103 fstub/fstubex.c
104 fstub/halstub.c
105 inbv/inbv.c
106 inbv/inbvport.c
107 io/iomgr/adapter.c
108 io/iomgr/arcname.c
109 io/iomgr/bootlog.c
110 io/iomgr/controller.c
111 io/iomgr/device.c
112 io/iomgr/deviface.c
113 io/iomgr/driver.c
114 io/iomgr/error.c
115 io/iomgr/file.c
116 io/iomgr/iocomp.c
117 io/iomgr/ioevent.c
118 io/iomgr/iofunc.c
119 io/iomgr/iomdl.c
120 io/iomgr/iomgr.c
121 io/iomgr/iorsrce.c
122 io/iomgr/iotimer.c
123 io/iomgr/iowork.c
124 io/iomgr/irp.c
125 io/iomgr/irq.c
126 io/iomgr/ramdisk.c
127 io/iomgr/rawfs.c
128 io/iomgr/remlock.c
129 io/iomgr/symlink.c
130 io/iomgr/util.c
131 io/iomgr/volume.c
132 io/pnpmgr/plugplay.c
133 io/pnpmgr/pnpdma.c
134 io/pnpmgr/pnpinit.c
135 io/pnpmgr/pnpmgr.c
136 io/pnpmgr/pnpnotify.c
137 io/pnpmgr/pnpreport.c
138 io/pnpmgr/pnpres.c
139 io/pnpmgr/pnproot.c
140 io/pnpmgr/pnputil.c
141 ke/apc.c
142 ke/balmgr.c
143 ke/bug.c
144 ke/clock.c
145 ke/config.c
146 ke/devqueue.c
147 ke/dpc.c
148 ke/eventobj.c
149 ke/except.c
150 ke/freeze.c
151 ke/gate.c
152 ke/gmutex.c
153 ke/ipi.c
154 ke/krnlinit.c
155 ke/mutex.c
156 ke/procobj.c
157 ke/profobj.c
158 ke/queue.c
159 ke/semphobj.c
160 ke/spinlock.c
161 ke/thrdobj.c
162 ke/thrdschd.c
163 ke/time.c
164 ke/timerobj.c
165 ke/wait.c
166 lpc/close.c
167 lpc/complete.c
168 lpc/connect.c
169 lpc/create.c
170 lpc/listen.c
171 lpc/port.c
172 lpc/reply.c
173 lpc/send.c
174 mm/ARM3/contmem.c
175 mm/ARM3/drvmgmt.c
176 mm/ARM3/dynamic.c
177 mm/ARM3/expool.c
178 mm/ARM3/hypermap.c
179 mm/ARM3/iosup.c
180 mm/ARM3/largepag.c
181 mm/ARM3/mdlsup.c
182 mm/ARM3/mmdbg.c
183 mm/ARM3/mminit.c
184 mm/ARM3/mmsup.c
185 mm/ARM3/ncache.c
186 mm/ARM3/pagfault.c
187 mm/ARM3/pfnlist.c
188 mm/ARM3/pool.c
189 mm/ARM3/procsup.c
190 mm/ARM3/section.c
191 mm/ARM3/sysldr.c
192 mm/ARM3/syspte.c
193 mm/ARM3/vadnode.c
194 mm/ARM3/virtual.c
195 mm/ARM3/zeropage.c
196 mm/anonmem.c
197 mm/balance.c
198 mm/freelist.c
199 mm/marea.c
200 mm/mmfault.c
201 mm/mminit.c
202 mm/pagefile.c
203 mm/pageop.c
204 mm/region.c
205 mm/rmap.c
206 mm/section.c
207 ob/obdir.c
208 ob/obhandle.c
209 ob/obinit.c
210 ob/oblife.c
211 ob/oblink.c
212 ob/obname.c
213 ob/obref.c
214 ob/obsdcach.c
215 ob/obsecure.c
216 ob/obwait.c
217 po/events.c
218 po/guid.c
219 po/poshtdwn.c
220 po/povolume.c
221 po/power.c
222 ps/debug.c
223 ps/job.c
224 ps/kill.c
225 ps/process.c
226 ps/psmgr.c
227 ps/psnotify.c
228 ps/query.c
229 ps/quota.c
230 ps/security.c
231 ps/state.c
232 ps/thread.c
233 ps/win32.c
234 rtl/libsupp.c
235 rtl/misc.c
236 se/access.c
237 se/acl.c
238 se/audit.c
239 se/lsa.c
240 se/priv.c
241 se/sd.c
242 se/semgr.c
243 se/sid.c
244 se/token.c
245 vf/driver.c
246 wmi/wmi.c
247 ntoskrnl.rc
248 ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
249 ntoskrnl_${ARCH}.def)
250
251 set_source_files_properties(ntoskrnl_${ARCH}.def PROPERTIES EXTERNAL_OBJECT TRUE)
252
253 if(ARCH MATCHES i386)
254 list(APPEND SOURCE
255 config/i386/cmhardwr.c
256 ex/i386/interlck_asm.S
257 ex/i386/fastinterlck_asm.S
258 ex/i386/ioport.S
259 ke/freeldr.c
260 ke/i386/abios.c
261 ke/i386/cpu.c
262 ke/i386/context.c
263 ke/i386/ctxswitch.S
264 ke/i386/exp.c
265 ke/i386/irqobj.c
266 ke/i386/kiinit.c
267 ke/i386/ldt.c
268 ke/i386/mtrr.c
269 ke/i386/patpge.c
270 ke/i386/thrdini.c
271 ke/i386/trap.s
272 ke/i386/traphdlr.c
273 ke/i386/usercall_asm.S
274 ke/i386/usercall.c
275 ke/i386/v86vdm.c
276 mm/i386/page.c
277 mm/ARM3/i386/init.c
278 ps/i386/psctx.c
279 ps/i386/psldt.c
280 rtl/i386/stack.S
281 vdm/vdmmain.c
282 vdm/vdmexec.c)
283 elseif(ARCH MATCHES amd64)
284 list(APPEND SOURCE
285 config/i386/cmhardwr.c
286 ex/amd64/fastinterlck.c
287 ke/amd64/boot.S
288 ke/amd64/context.c
289 ke/amd64/cpu.c
290 ke/amd64/ctxswitch.S
291 ke/amd64/except.c
292 ke/amd64/interrupt.c
293 ke/amd64/irql.c
294 ke/amd64/kiinit.c
295 ke/amd64/spinlock.c
296 ke/amd64/stubs.c
297 ke/amd64/thrdini.c
298 ke/amd64/trap.S
299 mm/amd64/init.c
300 mm/amd64/page.c
301 ps/amd64/psctx.c)
302 elseif(ARCH MATCHES arm)
303 list(APPEND SOURCE
304 config/arm/cmhardwr.c
305 ke/arm/boot.s
306 ke/arm/cpu.c
307 ke/arm/ctxswtch.s
308 ke/arm/exp.c
309 ke/arm/kiinit.c
310 ke/arm/stubs_asm.s
311 ke/arm/thrdini.c
312 ke/arm/trap.s
313 ke/arm/trapc.c
314 ke/arm/usercall.c
315 mm/arm/page.c
316 mm/ARM3/arm/init.c
317 ps/arm/psctx.c
318 rtl/arm/rtlexcpt.c)
319 elseif(ARCH MATCHES powerpc)
320 list(APPEND SOURCE
321 config/powerpc/cmhardwr.c
322 ke/powerpc/main_asm.S
323 ke/powerpc/cpu.c
324 ke/powerpc/exp.c
325 ke/powerpc/kiinit.c
326 ke/powerpc/ppc_irq.c
327 ke/powerpc/stubs.c
328 ke/powerpc/systimer.c
329 ke/powerpc/thrdini.c
330 ke/powerpc/ctxswitch.c
331 ke/powerpc/ctxhelp.S
332 mm/powerpc/pfault.c
333 mm/powerpc/page.c)
334 endif(ARCH MATCHES i386)
335
336 if(NOT _WINKD_)
337
338 if(ARCH MATCHES i386)
339 list(APPEND SOURCE
340 kd/i386/kdmemsup.c
341 kd/wrappers/gdbstub.c)
342
343 if(KDBG)
344 list(APPEND SOURCE
345 kdbg/i386/i386-dis.c
346 kdbg/i386/kdb_help.S)
347 endif(KDBG)
348
349 elseif(ARCH MATCHES amd64)
350 list(APPEND SOURCE
351 kd/amd64/kd.c
352 kd/amd64/kdmemsup.c)
353
354 if(KDBG)
355 list(APPEND SOURCE
356 kdbg/amd64/i386-dis.c
357 kdbg/amd64/kdb_help.S
358 kdbg/amd64/kdb.c)
359 endif(KDBG)
360
361 elseif(ARCH MATCHES powerpc)
362 list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c)
363
364 endif(ARCH MATCHES i386)
365
366 if(KDBG)
367 list(APPEND SOURCE
368 kdbg/kdb.c
369 kdbg/kdb_cli.c
370 kdbg/kdb_expr.c
371 kdbg/kdb_keyboard.c
372 kdbg/kdb_serial.c)
373 endif(KDBG)
374
375 if(DBG OR KDBG)
376 list(APPEND SOURCE kdbg/kdb_symbols.c)
377 endif(DBG OR KDBG)
378
379 list(APPEND SOURCE
380 kd/wrappers/bochs.c
381 kd/wrappers/kdbg.c
382 kd/kdinit.c
383 kd/kdio.c
384 kd/kdmain.c)
385
386 else() # _WINKD_
387
388 list(APPEND SOURCE
389 kd64/kdapi.c
390 kd64/kdbreak.c
391 kd64/kddata.c
392 kd64/kdinit.c
393 kd64/kdlock.c
394 kd64/kdprint.c
395 kd64/kdtrap.c)
396
397 if(ARCH MATCHES i386)
398 list(APPEND SOURCE kd64/i386/kdx86.c)
399 elseif(ARCH MATCHES amd64)
400 list(APPEND SOURCE kd64/amd64/kdx64.c)
401 elseif(ARCH MATCHES arm)
402 list(APPEND SOURCE kd64/arm/kdarm.c)
403 endif(ARCH MATCHES i386)
404
405 endif(NOT _WINKD_)
406
407 add_executable(ntoskrnl ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl_ntoskrnl.h.gch ${SOURCE})
408
409 set_entrypoint(ntoskrnl KiSystemStartup@4)
410 set_subsystem(ntoskrnl native)
411 set_image_base(ntoskrnl 0x80800000)
412
413 target_link_libraries(ntoskrnl
414 cportlib
415 csq
416 ${PSEH_LIB}
417 cmlib
418 rtl
419 rossym
420 libcntpr
421 wdmguid
422 ioevent)
423
424 add_importlibs(ntoskrnl hal kdcom bootvid)
425
426 add_pch(ntoskrnl ${CMAKE_CURRENT_SOURCE_DIR}/include/ntoskrnl.h ${SOURCE})
427 set_source_files_properties(${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S PROPERTIES GENERATED TRUE)
428 add_dependencies(ntoskrnl psdk bugcodes kernel_zw kernel_napi asm)
429
430 add_minicd_target(ntoskrnl reactos ntoskrnl.exe)
431 add_livecd_target(ntoskrnl reactos/system32)
432 add_importlib_target(ntoskrnl.spec)