mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 13:52:30 +00:00
e71cf78478
Use spec file for ntoskrnl and set image base to 0x00400000 on MSVC builds. This is the value that Windows has and the ms linker doesn't like to use the kernel address. svn path=/branches/cmake-bringup/; revision=49709
438 lines
8.5 KiB
CMake
438 lines
8.5 KiB
CMake
|
|
spec2def(ntoskrnl.exe ntoskrnl.spec)
|
|
|
|
include_directories(
|
|
${REACTOS_SOURCE_DIR}
|
|
${REACTOS_SOURCE_DIR}/lib/cmlib
|
|
include
|
|
${CMAKE_CURRENT_BINARY_DIR}/include
|
|
${CMAKE_CURRENT_BINARY_DIR}/include/internal
|
|
${REACTOS_SOURCE_DIR}/include/reactos/drivers)
|
|
|
|
add_definitions(
|
|
-D__NTOSKRNL__
|
|
-D_NTOSKRNL_
|
|
-D_NTSYSTEM_
|
|
-D_IN_KERNEL_
|
|
-DNTDDI_VERSION=0x05020400)
|
|
|
|
set_rc_compiler()
|
|
|
|
list(APPEND SOURCE
|
|
cc/cacheman.c
|
|
cc/copy.c
|
|
cc/fs.c
|
|
cc/mdl.c
|
|
cc/pin.c
|
|
cc/view.c
|
|
config/cmalloc.c
|
|
config/cmapi.c
|
|
config/cmboot.c
|
|
config/cmcheck.c
|
|
config/cmconfig.c
|
|
config/cmcontrl.c
|
|
config/cmdata.c
|
|
config/cmdelay.c
|
|
config/cmhook.c
|
|
config/cmhvlist.c
|
|
config/cmindex.c
|
|
config/cminit.c
|
|
config/cmkcbncb.c
|
|
config/cmkeydel.c
|
|
config/cmlazy.c
|
|
config/cmmapvw.c
|
|
config/cmname.c
|
|
config/cmnotify.c
|
|
config/cmparse.c
|
|
config/cmquota.c
|
|
config/cmse.c
|
|
config/cmsecach.c
|
|
config/cmsysini.c
|
|
config/cmvalche.c
|
|
config/cmvalue.c
|
|
config/cmwraprs.c
|
|
config/ntapi.c
|
|
dbgk/dbgkobj.c
|
|
dbgk/dbgkutil.c
|
|
ex/atom.c
|
|
ex/callback.c
|
|
ex/dbgctrl.c
|
|
ex/efi.c
|
|
ex/event.c
|
|
ex/evtpair.c
|
|
ex/exintrin.c
|
|
ex/fastinterlck.c
|
|
ex/fmutex.c
|
|
ex/handle.c
|
|
ex/harderr.c
|
|
ex/hdlsterm.c
|
|
ex/init.c
|
|
ex/keyedevt.c
|
|
ex/locale.c
|
|
ex/lookas.c
|
|
ex/mutant.c
|
|
ex/profile.c
|
|
ex/pushlock.c
|
|
ex/resource.c
|
|
ex/rundown.c
|
|
ex/sem.c
|
|
ex/shutdown.c
|
|
ex/sysinfo.c
|
|
ex/time.c
|
|
ex/timer.c
|
|
ex/uuid.c
|
|
ex/win32k.c
|
|
ex/work.c
|
|
ex/xipdisp.c
|
|
ex/zone.c
|
|
fsrtl/dbcsname.c
|
|
fsrtl/fastio.c
|
|
fsrtl/faulttol.c
|
|
fsrtl/filelock.c
|
|
fsrtl/filter.c
|
|
fsrtl/filtrctx.c
|
|
fsrtl/fsfilter.c
|
|
fsrtl/fsrtlpc.c
|
|
fsrtl/largemcb.c
|
|
fsrtl/name.c
|
|
fsrtl/notify.c
|
|
fsrtl/oplock.c
|
|
fsrtl/pnp.c
|
|
fsrtl/stackovf.c
|
|
fsrtl/tunnel.c
|
|
fsrtl/unc.c
|
|
fstub/disksup.c
|
|
fstub/fstubex.c
|
|
fstub/halstub.c
|
|
inbv/inbv.c
|
|
inbv/inbvport.c
|
|
io/iomgr/adapter.c
|
|
io/iomgr/arcname.c
|
|
io/iomgr/bootlog.c
|
|
io/iomgr/controller.c
|
|
io/iomgr/device.c
|
|
io/iomgr/deviface.c
|
|
io/iomgr/driver.c
|
|
io/iomgr/error.c
|
|
io/iomgr/file.c
|
|
io/iomgr/iocomp.c
|
|
io/iomgr/ioevent.c
|
|
io/iomgr/iofunc.c
|
|
io/iomgr/iomdl.c
|
|
io/iomgr/iomgr.c
|
|
io/iomgr/iorsrce.c
|
|
io/iomgr/iotimer.c
|
|
io/iomgr/iowork.c
|
|
io/iomgr/irp.c
|
|
io/iomgr/irq.c
|
|
io/iomgr/ramdisk.c
|
|
io/iomgr/rawfs.c
|
|
io/iomgr/remlock.c
|
|
io/iomgr/symlink.c
|
|
io/iomgr/util.c
|
|
io/iomgr/volume.c
|
|
io/pnpmgr/plugplay.c
|
|
io/pnpmgr/pnpdma.c
|
|
io/pnpmgr/pnpinit.c
|
|
io/pnpmgr/pnpmgr.c
|
|
io/pnpmgr/pnpnotify.c
|
|
io/pnpmgr/pnpreport.c
|
|
io/pnpmgr/pnpres.c
|
|
io/pnpmgr/pnproot.c
|
|
io/pnpmgr/pnputil.c
|
|
ke/apc.c
|
|
ke/balmgr.c
|
|
ke/bug.c
|
|
ke/clock.c
|
|
ke/config.c
|
|
ke/devqueue.c
|
|
ke/dpc.c
|
|
ke/eventobj.c
|
|
ke/except.c
|
|
ke/freeze.c
|
|
ke/gate.c
|
|
ke/gmutex.c
|
|
ke/ipi.c
|
|
ke/krnlinit.c
|
|
ke/mutex.c
|
|
ke/procobj.c
|
|
ke/profobj.c
|
|
ke/queue.c
|
|
ke/semphobj.c
|
|
ke/spinlock.c
|
|
ke/thrdobj.c
|
|
ke/thrdschd.c
|
|
ke/time.c
|
|
ke/timerobj.c
|
|
ke/wait.c
|
|
lpc/close.c
|
|
lpc/complete.c
|
|
lpc/connect.c
|
|
lpc/create.c
|
|
lpc/listen.c
|
|
lpc/port.c
|
|
lpc/reply.c
|
|
lpc/send.c
|
|
mm/ARM3/contmem.c
|
|
mm/ARM3/drvmgmt.c
|
|
mm/ARM3/dynamic.c
|
|
mm/ARM3/expool.c
|
|
mm/ARM3/hypermap.c
|
|
mm/ARM3/iosup.c
|
|
mm/ARM3/largepag.c
|
|
mm/ARM3/mdlsup.c
|
|
mm/ARM3/mmdbg.c
|
|
mm/ARM3/mminit.c
|
|
mm/ARM3/mmsup.c
|
|
mm/ARM3/ncache.c
|
|
mm/ARM3/pagfault.c
|
|
mm/ARM3/pfnlist.c
|
|
mm/ARM3/pool.c
|
|
mm/ARM3/procsup.c
|
|
mm/ARM3/section.c
|
|
mm/ARM3/sysldr.c
|
|
mm/ARM3/syspte.c
|
|
mm/ARM3/vadnode.c
|
|
mm/ARM3/virtual.c
|
|
mm/ARM3/zeropage.c
|
|
mm/anonmem.c
|
|
mm/balance.c
|
|
mm/freelist.c
|
|
mm/marea.c
|
|
mm/mmfault.c
|
|
mm/mminit.c
|
|
mm/pagefile.c
|
|
mm/pageop.c
|
|
mm/region.c
|
|
mm/rmap.c
|
|
mm/section.c
|
|
ob/obdir.c
|
|
ob/obhandle.c
|
|
ob/obinit.c
|
|
ob/oblife.c
|
|
ob/oblink.c
|
|
ob/obname.c
|
|
ob/obref.c
|
|
ob/obsdcach.c
|
|
ob/obsecure.c
|
|
ob/obwait.c
|
|
po/events.c
|
|
po/guid.c
|
|
po/poshtdwn.c
|
|
po/povolume.c
|
|
po/power.c
|
|
ps/debug.c
|
|
ps/job.c
|
|
ps/kill.c
|
|
ps/process.c
|
|
ps/psmgr.c
|
|
ps/psnotify.c
|
|
ps/query.c
|
|
ps/quota.c
|
|
ps/security.c
|
|
ps/state.c
|
|
ps/thread.c
|
|
ps/win32.c
|
|
rtl/libsupp.c
|
|
rtl/misc.c
|
|
se/access.c
|
|
se/acl.c
|
|
se/audit.c
|
|
se/lsa.c
|
|
se/priv.c
|
|
se/sd.c
|
|
se/semgr.c
|
|
se/sid.c
|
|
se/token.c
|
|
vf/driver.c
|
|
wmi/wmi.c
|
|
ntoskrnl.rc
|
|
${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
|
|
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
|
|
|
|
set_source_files_properties(ntoskrnl_${ARCH}.def PROPERTIES EXTERNAL_OBJECT TRUE)
|
|
|
|
if(ARCH MATCHES i386)
|
|
list(APPEND SOURCE
|
|
config/i386/cmhardwr.c
|
|
ex/i386/interlck_asm.S
|
|
ex/i386/fastinterlck_asm.S
|
|
ex/i386/ioport.S
|
|
ke/freeldr.c
|
|
ke/i386/abios.c
|
|
ke/i386/cpu.c
|
|
ke/i386/context.c
|
|
ke/i386/ctxswitch.S
|
|
ke/i386/exp.c
|
|
ke/i386/irqobj.c
|
|
ke/i386/kiinit.c
|
|
ke/i386/ldt.c
|
|
ke/i386/mtrr.c
|
|
ke/i386/patpge.c
|
|
ke/i386/thrdini.c
|
|
ke/i386/trap.s
|
|
ke/i386/traphdlr.c
|
|
ke/i386/usercall_asm.S
|
|
ke/i386/usercall.c
|
|
ke/i386/v86vdm.c
|
|
mm/i386/page.c
|
|
mm/ARM3/i386/init.c
|
|
ps/i386/psctx.c
|
|
ps/i386/psldt.c
|
|
rtl/i386/stack.S
|
|
vdm/vdmmain.c
|
|
vdm/vdmexec.c)
|
|
elseif(ARCH MATCHES amd64)
|
|
list(APPEND SOURCE
|
|
config/i386/cmhardwr.c
|
|
ex/amd64/fastinterlck.c
|
|
ke/amd64/boot.S
|
|
ke/amd64/context.c
|
|
ke/amd64/cpu.c
|
|
ke/amd64/ctxswitch.S
|
|
ke/amd64/except.c
|
|
ke/amd64/interrupt.c
|
|
ke/amd64/irql.c
|
|
ke/amd64/kiinit.c
|
|
ke/amd64/spinlock.c
|
|
ke/amd64/stubs.c
|
|
ke/amd64/thrdini.c
|
|
ke/amd64/trap.S
|
|
mm/amd64/init.c
|
|
mm/amd64/page.c
|
|
ps/amd64/psctx.c)
|
|
elseif(ARCH MATCHES arm)
|
|
list(APPEND SOURCE
|
|
config/arm/cmhardwr.c
|
|
ke/arm/boot.s
|
|
ke/arm/cpu.c
|
|
ke/arm/ctxswtch.s
|
|
ke/arm/exp.c
|
|
ke/arm/kiinit.c
|
|
ke/arm/stubs_asm.s
|
|
ke/arm/thrdini.c
|
|
ke/arm/trap.s
|
|
ke/arm/trapc.c
|
|
ke/arm/usercall.c
|
|
mm/arm/page.c
|
|
mm/ARM3/arm/init.c
|
|
ps/arm/psctx.c
|
|
rtl/arm/rtlexcpt.c)
|
|
elseif(ARCH MATCHES powerpc)
|
|
list(APPEND SOURCE
|
|
config/powerpc/cmhardwr.c
|
|
ke/powerpc/main_asm.S
|
|
ke/powerpc/cpu.c
|
|
ke/powerpc/exp.c
|
|
ke/powerpc/kiinit.c
|
|
ke/powerpc/ppc_irq.c
|
|
ke/powerpc/stubs.c
|
|
ke/powerpc/systimer.c
|
|
ke/powerpc/thrdini.c
|
|
ke/powerpc/ctxswitch.c
|
|
ke/powerpc/ctxhelp.S
|
|
mm/powerpc/pfault.c
|
|
mm/powerpc/page.c)
|
|
endif(ARCH MATCHES i386)
|
|
|
|
if(NOT _WINKD_)
|
|
|
|
if(ARCH MATCHES i386)
|
|
list(APPEND SOURCE
|
|
kd/i386/kdmemsup.c
|
|
kd/wrappers/gdbstub.c)
|
|
|
|
if(KDBG)
|
|
list(APPEND SOURCE
|
|
kdbg/i386/i386-dis.c
|
|
kdbg/i386/kdb_help.S)
|
|
endif(KDBG)
|
|
|
|
elseif(ARCH MATCHES amd64)
|
|
list(APPEND SOURCE
|
|
kd/amd64/kd.c
|
|
kd/amd64/kdmemsup.c)
|
|
|
|
if(KDBG)
|
|
list(APPEND SOURCE
|
|
kdbg/amd64/i386-dis.c
|
|
kdbg/amd64/kdb_help.S
|
|
kdbg/amd64/kdb.c)
|
|
endif(KDBG)
|
|
|
|
elseif(ARCH MATCHES powerpc)
|
|
list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c)
|
|
|
|
endif(ARCH MATCHES i386)
|
|
|
|
if(KDBG)
|
|
list(APPEND SOURCE
|
|
kdbg/kdb.c
|
|
kdbg/kdb_cli.c
|
|
kdbg/kdb_expr.c
|
|
kdbg/kdb_keyboard.c
|
|
kdbg/kdb_serial.c)
|
|
endif(KDBG)
|
|
|
|
if(DBG OR KDBG)
|
|
list(APPEND SOURCE kdbg/kdb_symbols.c)
|
|
endif(DBG OR KDBG)
|
|
|
|
list(APPEND SOURCE
|
|
kd/wrappers/bochs.c
|
|
kd/wrappers/kdbg.c
|
|
kd/kdinit.c
|
|
kd/kdio.c
|
|
kd/kdmain.c)
|
|
|
|
else() # _WINKD_
|
|
|
|
list(APPEND SOURCE
|
|
kd64/kdapi.c
|
|
kd64/kdbreak.c
|
|
kd64/kddata.c
|
|
kd64/kdinit.c
|
|
kd64/kdlock.c
|
|
kd64/kdprint.c
|
|
kd64/kdtrap.c)
|
|
|
|
if(ARCH MATCHES i386)
|
|
list(APPEND SOURCE kd64/i386/kdx86.c)
|
|
elseif(ARCH MATCHES amd64)
|
|
list(APPEND SOURCE kd64/amd64/kdx64.c)
|
|
elseif(ARCH MATCHES arm)
|
|
list(APPEND SOURCE kd64/arm/kdarm.c)
|
|
endif(ARCH MATCHES i386)
|
|
|
|
endif(NOT _WINKD_)
|
|
|
|
add_executable(ntoskrnl ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl_ntoskrnl.h.gch ${SOURCE})
|
|
|
|
set_entrypoint(ntoskrnl KiSystemStartup@4)
|
|
set_subsystem(ntoskrnl native)
|
|
if(MSVC)
|
|
set_image_base(ntoskrnl 0x00400000)
|
|
else()
|
|
set_image_base(ntoskrnl 0x80800000)
|
|
endif()
|
|
|
|
target_link_libraries(ntoskrnl
|
|
cportlib
|
|
csq
|
|
${PSEH_LIB}
|
|
cmlib
|
|
rtl
|
|
rossym
|
|
libcntpr
|
|
wdmguid
|
|
ioevent)
|
|
|
|
add_importlibs(ntoskrnl hal kdcom bootvid)
|
|
|
|
add_pch(ntoskrnl ${CMAKE_CURRENT_SOURCE_DIR}/include/ntoskrnl.h ${SOURCE})
|
|
set_source_files_properties(${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S PROPERTIES GENERATED TRUE)
|
|
add_dependencies(ntoskrnl psdk bugcodes kernel_zw kernel_napi asm)
|
|
|
|
add_minicd_target(ntoskrnl reactos ntoskrnl.exe)
|
|
add_livecd_target(ntoskrnl reactos/system32)
|
|
add_importlib_target(ntoskrnl.spec)
|