build: Convert xemu Makefiles to meson

This commit is contained in:
Matt Borgerson 2021-04-18 22:08:02 -07:00
parent d1d32026f8
commit 609aee0bbe
15 changed files with 128 additions and 48 deletions

View File

@ -38,6 +38,7 @@ subdir('usb')
subdir('vfio')
subdir('virtio')
subdir('watchdog')
subdir('xbox')
subdir('xen')
subdir('xenpv')

View File

@ -1,11 +0,0 @@
obj-y += xbox.o
obj-y += chihiro.o
obj-y += xbox_pci.o acpi_xbox.o
obj-y += amd_smbus.o smbus_xbox_smc.o smbus_cx25871.o smbus_adm1032.o smbus_storage.o eeprom_generation.o
obj-y += nvnet.o
obj-y += lpc47m157.o
obj-y += xid.o
obj-y += chihiro-usb.o
obj-y += nv2a/
obj-y += mcpx/

View File

@ -1,4 +0,0 @@
obj-y += apu.o aci.o
apu.o-cflags := $(SDL_CFLAGS)
obj-y += dsp/

View File

@ -1,5 +0,0 @@
obj-y += dsp.o dsp_cpu.o dsp_dma.o
# dsp_cpu.c uses SDL_GetTicks()
dsp_cpu.o-cflags := $(SDL_CFLAGS)
dsp_cpu.o-libs := $(SDL_LIBS)

10
hw/xbox/mcpx/meson.build Normal file
View File

@ -0,0 +1,10 @@
mcpx_ss = ss.source_set()
mcpx_ss.add(sdl, libsamplerate, files(
'apu.c',
'aci.c',
'dsp/dsp.c',
'dsp/dsp_cpu.c',
'dsp/dsp_dma.c',
))
specific_ss.add_all(mcpx_ss)

18
hw/xbox/meson.build Normal file
View File

@ -0,0 +1,18 @@
specific_ss.add(files(
'acpi_xbox.c',
'amd_smbus.c',
# 'chihiro-usb.c',
# 'chihiro.c',
'eeprom_generation.c',
'lpc47m157.c',
'nvnet.c',
'smbus_adm1032.c',
'smbus_cx25871.c',
'smbus_storage.c',
'smbus_xbox_smc.c',
'xbox.c',
'xbox_pci.c',
'xid.c',
))
subdir('nv2a')
subdir('mcpx')

View File

@ -1,22 +0,0 @@
obj-y += nv2a.o
obj-y += debug.o
obj-y += pbus.o
obj-y += pcrtc.o
obj-y += pfb.o
obj-y += pfifo.o
obj-y += pgraph.o
obj-y += pmc.o
obj-y += pramdac.o
obj-y += prmcio.o
obj-y += prmvio.o
obj-y += psh.o
obj-y += ptimer.o
obj-y += pvideo.o
obj-y += shaders.o
obj-y += stubs.o
obj-y += user.o
obj-y += vsh.o
obj-y += gl/
obj-y += swizzle.o
obj-y += s3tc.o

View File

@ -1,2 +0,0 @@
obj-y += gloffscreen_common.o gloffscreen_sdl.o
gloffscreen_sdl.o-cflags := $(SDL_CFLAGS)

View File

@ -0,0 +1,6 @@
softmmu_ss.add([sdl, files(
'gloffscreen_common.c',
'gloffscreen_sdl.c',
)])
# gloffscreen_sdl.o-cflags := $(SDL_CFLAGS)

23
hw/xbox/nv2a/meson.build Normal file
View File

@ -0,0 +1,23 @@
specific_ss.add(files(
'nv2a.c',
'debug.c',
'pbus.c',
'pcrtc.c',
'pfb.c',
'pfifo.c',
'pgraph.c',
'pmc.c',
'pramdac.c',
'prmcio.c',
'prmvio.c',
'psh.c',
'ptimer.c',
'pvideo.c',
'shaders.c',
'stubs.c',
'user.c',
'vsh.c',
'swizzle.c',
's3tc.c',
))
subdir('gl')

View File

@ -813,6 +813,15 @@ if 'CONFIG_OPENGL' in config_host
link_args: config_host['OPENGL_LIBS'].split())
endif
xemu_gtk = declare_dependency(compile_args: config_host['XEMU_GTK_CFLAGS'].split(),
link_args: config_host['XEMU_GTK_LIBS'].split())
openssl = declare_dependency(compile_args: config_host['OPENSSL_CFLAGS'].split(),
link_args: config_host['OPENSSL_LIBS'].split())
libsamplerate = declare_dependency(compile_args: config_host['LIBSAMPLERATE_CFLAGS'].split(),
link_args: config_host['LIBSAMPLERATE_LIBS'].split())
gtk = not_found
gtkx11 = not_found
if not get_option('gtk').auto() or (have_system and not cocoa.found())
@ -1705,15 +1714,14 @@ qemu_version = custom_target('qemu-version.h',
xemu_version_cmd = [find_program('scripts/xemu-version.sh'),
meson.current_source_dir()]
xemu_version = custom_target('xemu-version.h',
output: 'xemu-version.h',
xemu_version = custom_target('xemu-version.c',
output: 'xemu-version.c',
command: xemu_version_cmd,
capture: true,
build_by_default: true,
build_always_stale: true)
genh += qemu_version
genh += xemu_version
hxdep = []
hx_headers = [
@ -1938,6 +1946,14 @@ if have_block
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
endif
specific_ss.add(files('xemu-xbe.c'))
libxemuver = static_library('xemuver', sources: xemu_version,
name_suffix: 'fa',
build_by_default: false)
xemuver = declare_dependency(link_whole: libxemuver)
common_ss.add(xemuver)
common_ss.add(files('cpus-common.c'))
subdir('softmmu')

View File

@ -3,6 +3,7 @@ i386_ss.add(when: 'CONFIG_TCG', if_true: files(
'cc_helper.c',
'excp_helper.c',
'fpu_helper.c',
'fpu_helper_hard.c',
'int_helper.c',
'mem_helper.c',
'misc_helper.c',

View File

@ -12,6 +12,54 @@ softmmu_ss.add(files(
'keymaps.c',
'qemu-pixman.c',
))
xemu_ss = ss.source_set()
xemu_ss.add(files(
'imgui/imgui.cpp',
'imgui/imgui_draw.cpp',
'imgui/imgui_tables.cpp',
'imgui/imgui_demo.cpp',
'imgui/imgui_widgets.cpp',
'imgui/backends/imgui_impl_opengl3.cpp',
'imgui/backends/imgui_impl_sdl.cpp',
'implot/implot.cpp',
'implot/implot_demo.cpp',
'implot/implot_items.cpp',
'xemu.c',
'xemu-custom-widgets.c',
'xemu-data.c',
'xemu-input.c',
'xemu-monitor.c',
'xemu-net.c',
'xemu-settings.c',
'xemu-shaders.c',
'xemu-hud.cc',
'xemu-reporting.cc',
))
imgui_flags = ['-DIMGUI_IMPL_OPENGL_LOADER_CUSTOM="epoxy/gl.h"',
'-Iui/imgui']
if 'CONFIG_WIN32' in config_host
imgui_flags += ['-DWIN32', '-DMINGW32']
endif
if 'CONFIG_LINUX' in config_host
imgui_flags += ['-DLINUX']
endif
if 'CONFIG_DARWIN' in config_host
imgui_flags += ['-DAPPLE']
endif
imgui = declare_dependency(compile_args: imgui_flags)
xemu_ss.add(sdl, opengl, openssl, imgui)
xemu_ss.add(when: 'CONFIG_LINUX', if_true: [xemu_gtk, files('xemu-os-utils-linux.c', 'noc_file_dialog_gtk.c')])
xemu_ss.add(when: 'CONFIG_WIN32', if_true: files('xemu-os-utils-windows.c', 'noc_file_dialog_win32.c'))
xemu_ss.add(when: 'CONFIG_DARWIN', if_true: files('xemu-os-utils-macos.m', 'noc_file_dialog_macos.m'))
softmmu_ss.add_all(xemu_ss)
softmmu_ss.add([spice_headers, files('spice-module.c')])
softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c'))
@ -80,7 +128,7 @@ if sdl.found()
))
sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
sdl_ss.add(when: x11, if_true: files('x_keymap.c'))
ui_modules += {'sdl' : sdl_ss}
# ui_modules += {'sdl' : sdl_ss}
endif
if config_host.has_key('CONFIG_SPICE')

View File

@ -2,6 +2,7 @@ shaders = [
['texture-blit', 'frag'],
['texture-blit', 'vert'],
['texture-blit-flip', 'vert'],
['xemu-logo', 'frag'],
]
foreach e : shaders