meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos
For consistency with other OSes, use if...endif for rules that are target-independent. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
53e8868d69
commit
dc4954943d
|
@ -10,8 +10,10 @@ system_ss.add([files(
|
||||||
'confidential-guest-support.c',
|
'confidential-guest-support.c',
|
||||||
), numa])
|
), numa])
|
||||||
|
|
||||||
system_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c'))
|
if targetos != 'windows'
|
||||||
system_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c'))
|
system_ss.add(files('rng-random.c'))
|
||||||
|
system_ss.add(files('hostmem-file.c'))
|
||||||
|
endif
|
||||||
if targetos == 'linux'
|
if targetos == 'linux'
|
||||||
system_ss.add(files('hostmem-memfd.c'))
|
system_ss.add(files('hostmem-memfd.c'))
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -88,8 +88,11 @@ if get_option('parallels').allowed()
|
||||||
block_ss.add(files('parallels.c', 'parallels-ext.c'))
|
block_ss.add(files('parallels.c', 'parallels-ext.c'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
|
if targetos == 'windows'
|
||||||
block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
|
block_ss.add(files('file-win32.c', 'win32-aio.c'))
|
||||||
|
else
|
||||||
|
block_ss.add(files('file-posix.c'), coref, iokit)
|
||||||
|
endif
|
||||||
block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
|
block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
|
||||||
if targetos == 'linux'
|
if targetos == 'linux'
|
||||||
block_ss.add(files('nvme.c'))
|
block_ss.add(files('nvme.c'))
|
||||||
|
|
|
@ -12,19 +12,21 @@ chardev_ss.add(files(
|
||||||
'char-udp.c',
|
'char-udp.c',
|
||||||
'char.c',
|
'char.c',
|
||||||
))
|
))
|
||||||
chardev_ss.add(when: 'CONFIG_POSIX', if_true: [files(
|
if targetos == 'windows'
|
||||||
'char-fd.c',
|
chardev_ss.add(files(
|
||||||
'char-pty.c',
|
|
||||||
), util])
|
|
||||||
if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly']
|
|
||||||
chardev_ss.add(files('char-parallel.c'))
|
|
||||||
endif
|
|
||||||
|
|
||||||
chardev_ss.add(when: 'CONFIG_WIN32', if_true: files(
|
|
||||||
'char-console.c',
|
'char-console.c',
|
||||||
'char-win-stdio.c',
|
'char-win-stdio.c',
|
||||||
'char-win.c',
|
'char-win.c',
|
||||||
))
|
))
|
||||||
|
else
|
||||||
|
chardev_ss.add(files(
|
||||||
|
'char-fd.c',
|
||||||
|
'char-pty.c',
|
||||||
|
), util)
|
||||||
|
if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly']
|
||||||
|
chardev_ss.add(files('char-parallel.c'))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
chardev_ss = chardev_ss.apply(config_targetos, strict: false)
|
chardev_ss = chardev_ss.apply(config_targetos, strict: false)
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,9 @@ system_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
|
||||||
system_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
|
system_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
|
||||||
system_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
|
system_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
|
||||||
system_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
|
system_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
|
||||||
system_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
|
if targetos != 'windows'
|
||||||
|
system_ss.add(when: 'CONFIG_USB_STORAGE_MTP', if_true: files('dev-mtp.c'))
|
||||||
|
endif
|
||||||
|
|
||||||
# smartcard
|
# smartcard
|
||||||
system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
|
system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
|
||||||
|
|
11
meson.build
11
meson.build
|
@ -2885,9 +2885,7 @@ endif
|
||||||
########################
|
########################
|
||||||
|
|
||||||
minikconf = find_program('scripts/minikconf.py')
|
minikconf = find_program('scripts/minikconf.py')
|
||||||
config_targetos = {
|
config_targetos = {}
|
||||||
(targetos == 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y'
|
|
||||||
}
|
|
||||||
|
|
||||||
config_all = {}
|
config_all = {}
|
||||||
config_all_devices = {}
|
config_all_devices = {}
|
||||||
|
@ -3480,8 +3478,11 @@ if have_block
|
||||||
|
|
||||||
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
|
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
|
||||||
# os-win32.c does not
|
# os-win32.c does not
|
||||||
blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
|
if targetos == 'windows'
|
||||||
system_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
|
system_ss.add(files('os-win32.c'))
|
||||||
|
else
|
||||||
|
blockdev_ss.add(files('os-posix.c'))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
common_ss.add(files('cpu-common.c'))
|
common_ss.add(files('cpu-common.c'))
|
||||||
|
|
|
@ -67,7 +67,15 @@ qga_ss.add(files(
|
||||||
'main.c',
|
'main.c',
|
||||||
'cutils.c',
|
'cutils.c',
|
||||||
))
|
))
|
||||||
qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
|
if targetos == 'windows'
|
||||||
|
qga_ss.add(files(
|
||||||
|
'channel-win32.c',
|
||||||
|
'commands-win32.c',
|
||||||
|
'service-win32.c',
|
||||||
|
'vss-win32.c'
|
||||||
|
))
|
||||||
|
else
|
||||||
|
qga_ss.add(files(
|
||||||
'channel-posix.c',
|
'channel-posix.c',
|
||||||
'commands-posix.c',
|
'commands-posix.c',
|
||||||
'commands-posix-ssh.c',
|
'commands-posix-ssh.c',
|
||||||
|
@ -77,12 +85,7 @@ if targetos == 'linux'
|
||||||
elif targetos in bsd_oses
|
elif targetos in bsd_oses
|
||||||
qga_ss.add(files('commands-bsd.c'))
|
qga_ss.add(files('commands-bsd.c'))
|
||||||
endif
|
endif
|
||||||
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
|
endif
|
||||||
'channel-win32.c',
|
|
||||||
'commands-win32.c',
|
|
||||||
'service-win32.c',
|
|
||||||
'vss-win32.c'
|
|
||||||
))
|
|
||||||
|
|
||||||
qga_ss = qga_ss.apply(config_targetos, strict: false)
|
qga_ss = qga_ss.apply(config_targetos, strict: false)
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,9 @@ if dbus_display
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if gtk.found()
|
if gtk.found()
|
||||||
system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
|
if targetos == 'windows'
|
||||||
|
system_ss.add(files('win32-kbd-hook.c'))
|
||||||
|
endif
|
||||||
|
|
||||||
gtk_ss = ss.source_set()
|
gtk_ss = ss.source_set()
|
||||||
gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
|
gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
|
||||||
|
@ -119,7 +121,9 @@ if gtk.found()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if sdl.found()
|
if sdl.found()
|
||||||
system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
|
if targetos == 'windows'
|
||||||
|
system_ss.add(files('win32-kbd-hook.c'))
|
||||||
|
endif
|
||||||
|
|
||||||
sdl_ss = ss.source_set()
|
sdl_ss = ss.source_set()
|
||||||
sdl_ss.add(sdl, sdl_image, pixman, glib, files(
|
sdl_ss.add(sdl, sdl_image, pixman, glib, files(
|
||||||
|
|
|
@ -3,28 +3,31 @@ util_ss.add(files('thread-context.c'), numa)
|
||||||
if not config_host_data.get('CONFIG_ATOMIC64')
|
if not config_host_data.get('CONFIG_ATOMIC64')
|
||||||
util_ss.add(files('atomic64.c'))
|
util_ss.add(files('atomic64.c'))
|
||||||
endif
|
endif
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c'))
|
if targetos != 'windows'
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c'))
|
util_ss.add(files('aio-posix.c'))
|
||||||
|
util_ss.add(files('fdmon-poll.c'))
|
||||||
if config_host_data.get('CONFIG_EPOLL_CREATE1')
|
if config_host_data.get('CONFIG_EPOLL_CREATE1')
|
||||||
util_ss.add(files('fdmon-epoll.c'))
|
util_ss.add(files('fdmon-epoll.c'))
|
||||||
endif
|
endif
|
||||||
util_ss.add(when: linux_io_uring, if_true: files('fdmon-io_uring.c'))
|
util_ss.add(files('compatfd.c'))
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c'))
|
util_ss.add(files('event_notifier-posix.c'))
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c'))
|
util_ss.add(files('mmap-alloc.c'))
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c'))
|
|
||||||
freebsd_dep = []
|
freebsd_dep = []
|
||||||
if targetos == 'freebsd'
|
if targetos == 'freebsd'
|
||||||
freebsd_dep = util
|
freebsd_dep = util
|
||||||
endif
|
endif
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: [files('oslib-posix.c'), freebsd_dep])
|
util_ss.add(files('oslib-posix.c'), freebsd_dep)
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('qemu-thread-posix.c'))
|
util_ss.add(files('qemu-thread-posix.c'))
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('memfd.c'))
|
util_ss.add(files('memfd.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: files('aio-win32.c'))
|
util_ss.add(files('drm.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: files('event_notifier-win32.c'))
|
else
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: files('oslib-win32.c'))
|
util_ss.add(files('aio-win32.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: files('qemu-thread-win32.c'))
|
util_ss.add(files('event_notifier-win32.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: winmm)
|
util_ss.add(files('oslib-win32.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: pathcch)
|
util_ss.add(files('qemu-thread-win32.c'))
|
||||||
|
util_ss.add(winmm, pathcch)
|
||||||
|
endif
|
||||||
|
util_ss.add(when: linux_io_uring, if_true: files('fdmon-io_uring.c'))
|
||||||
if glib_has_gslice
|
if glib_has_gslice
|
||||||
util_ss.add(files('qtree.c'))
|
util_ss.add(files('qtree.c'))
|
||||||
endif
|
endif
|
||||||
|
@ -56,7 +59,6 @@ util_ss.add(files('reserved-region.c'))
|
||||||
util_ss.add(files('stats64.c'))
|
util_ss.add(files('stats64.c'))
|
||||||
util_ss.add(files('systemd.c'))
|
util_ss.add(files('systemd.c'))
|
||||||
util_ss.add(files('transactions.c'))
|
util_ss.add(files('transactions.c'))
|
||||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c'))
|
|
||||||
util_ss.add(files('guest-random.c'))
|
util_ss.add(files('guest-random.c'))
|
||||||
util_ss.add(files('yank.c'))
|
util_ss.add(files('yank.c'))
|
||||||
util_ss.add(files('int128.c'))
|
util_ss.add(files('int128.c'))
|
||||||
|
|
Loading…
Reference in New Issue