From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 41/46] meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos
Date: Sun, 31 Dec 2023 09:44:57 +0100 [thread overview]
Message-ID: <20231231084502.235366-42-pbonzini@redhat.com> (raw)
In-Reply-To: <20231231084502.235366-1-pbonzini@redhat.com>
For consistency with other OSes, use if...endif for rules that are
target-independent.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
backends/meson.build | 6 ++++--
block/meson.build | 7 +++++--
chardev/meson.build | 26 ++++++++++++++------------
hw/usb/meson.build | 4 +++-
meson.build | 11 ++++++-----
qga/meson.build | 33 ++++++++++++++++++---------------
ui/meson.build | 8 ++++++--
util/meson.build | 44 +++++++++++++++++++++++---------------------
8 files changed, 79 insertions(+), 60 deletions(-)
diff --git a/backends/meson.build b/backends/meson.build
index 248ce4923c6..6dee4e9203b 100644
--- a/backends/meson.build
+++ b/backends/meson.build
@@ -10,8 +10,10 @@ system_ss.add([files(
'confidential-guest-support.c',
), numa])
-system_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c'))
-system_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c'))
+if targetos != 'windows'
+ system_ss.add(files('rng-random.c'))
+ system_ss.add(files('hostmem-file.c'))
+endif
if targetos == 'linux'
system_ss.add(files('hostmem-memfd.c'))
endif
diff --git a/block/meson.build b/block/meson.build
index 7faed96c1e7..ddea1e40070 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -88,8 +88,11 @@ if get_option('parallels').allowed()
block_ss.add(files('parallels.c', 'parallels-ext.c'))
endif
-block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
-block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
+if targetos == 'windows'
+ 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'))
if targetos == 'linux'
block_ss.add(files('nvme.c'))
diff --git a/chardev/meson.build b/chardev/meson.build
index 6d56ad32fdb..9564ace868b 100644
--- a/chardev/meson.build
+++ b/chardev/meson.build
@@ -12,20 +12,22 @@ chardev_ss.add(files(
'char-udp.c',
'char.c',
))
-chardev_ss.add(when: 'CONFIG_POSIX', if_true: [files(
- 'char-fd.c',
- 'char-pty.c',
-), util])
-if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly']
- chardev_ss.add(files('char-parallel.c'))
+if targetos == 'windows'
+ chardev_ss.add(files(
+ 'char-console.c',
+ 'char-win-stdio.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.add(when: 'CONFIG_WIN32', if_true: files(
- 'char-console.c',
- 'char-win-stdio.c',
- 'char-win.c',
-))
-
chardev_ss = chardev_ss.apply(config_targetos, strict: false)
system_ss.add(files(
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 4b44db39cd3..b7755b638fc 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -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_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_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
system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
diff --git a/meson.build b/meson.build
index cf224e252c6..e37ab286c23 100644
--- a/meson.build
+++ b/meson.build
@@ -2885,9 +2885,7 @@ endif
########################
minikconf = find_program('scripts/minikconf.py')
-config_targetos = {
- (targetos == 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y'
-}
+config_targetos = {}
config_all = {}
config_all_devices = {}
@@ -3480,8 +3478,11 @@ if have_block
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
# os-win32.c does not
- blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
- system_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
+ if targetos == 'windows'
+ system_ss.add(files('os-win32.c'))
+ else
+ blockdev_ss.add(files('os-posix.c'))
+ endif
endif
common_ss.add(files('cpu-common.c'))
diff --git a/qga/meson.build b/qga/meson.build
index 50edaf1c3d4..1113e7c7fae 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -67,22 +67,25 @@ qga_ss.add(files(
'main.c',
'cutils.c',
))
-qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
- 'channel-posix.c',
- 'commands-posix.c',
- 'commands-posix-ssh.c',
-))
-if targetos == 'linux'
- qga_ss.add(files('commands-linux.c'))
-elif targetos in bsd_oses
- qga_ss.add(files('commands-bsd.c'))
+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',
+ 'commands-posix.c',
+ 'commands-posix-ssh.c',
+ ))
+ if targetos == 'linux'
+ qga_ss.add(files('commands-linux.c'))
+ elif targetos in bsd_oses
+ qga_ss.add(files('commands-bsd.c'))
+ endif
endif
-qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
- 'channel-win32.c',
- 'commands-win32.c',
- 'service-win32.c',
- 'vss-win32.c'
-))
qga_ss = qga_ss.apply(config_targetos, strict: false)
diff --git a/ui/meson.build b/ui/meson.build
index 8379a788a1a..a370494c4ab 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -105,7 +105,9 @@ if dbus_display
endif
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.add(gtk, vte, pixman, files('gtk.c'))
@@ -119,7 +121,9 @@ if gtk.found()
endif
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.add(sdl, sdl_image, pixman, glib, files(
diff --git a/util/meson.build b/util/meson.build
index 98dd7fa5340..4e970d2b488 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -3,28 +3,31 @@ util_ss.add(files('thread-context.c'), numa)
if not config_host_data.get('CONFIG_ATOMIC64')
util_ss.add(files('atomic64.c'))
endif
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c'))
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c'))
-if config_host_data.get('CONFIG_EPOLL_CREATE1')
- util_ss.add(files('fdmon-epoll.c'))
+if targetos != 'windows'
+ util_ss.add(files('aio-posix.c'))
+ util_ss.add(files('fdmon-poll.c'))
+ if config_host_data.get('CONFIG_EPOLL_CREATE1')
+ util_ss.add(files('fdmon-epoll.c'))
+ endif
+ util_ss.add(files('compatfd.c'))
+ util_ss.add(files('event_notifier-posix.c'))
+ util_ss.add(files('mmap-alloc.c'))
+ freebsd_dep = []
+ if targetos == 'freebsd'
+ freebsd_dep = util
+ endif
+ util_ss.add(files('oslib-posix.c'), freebsd_dep)
+ util_ss.add(files('qemu-thread-posix.c'))
+ util_ss.add(files('memfd.c'))
+ util_ss.add(files('drm.c'))
+else
+ util_ss.add(files('aio-win32.c'))
+ util_ss.add(files('event_notifier-win32.c'))
+ util_ss.add(files('oslib-win32.c'))
+ 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'))
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c'))
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c'))
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c'))
-freebsd_dep = []
-if targetos == 'freebsd'
- freebsd_dep = util
-endif
-util_ss.add(when: 'CONFIG_POSIX', if_true: [files('oslib-posix.c'), freebsd_dep])
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('qemu-thread-posix.c'))
-util_ss.add(when: 'CONFIG_POSIX', if_true: files('memfd.c'))
-util_ss.add(when: 'CONFIG_WIN32', if_true: files('aio-win32.c'))
-util_ss.add(when: 'CONFIG_WIN32', if_true: files('event_notifier-win32.c'))
-util_ss.add(when: 'CONFIG_WIN32', if_true: files('oslib-win32.c'))
-util_ss.add(when: 'CONFIG_WIN32', if_true: files('qemu-thread-win32.c'))
-util_ss.add(when: 'CONFIG_WIN32', if_true: winmm)
-util_ss.add(when: 'CONFIG_WIN32', if_true: pathcch)
if glib_has_gslice
util_ss.add(files('qtree.c'))
endif
@@ -56,7 +59,6 @@ util_ss.add(files('reserved-region.c'))
util_ss.add(files('stats64.c'))
util_ss.add(files('systemd.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('yank.c'))
util_ss.add(files('int128.c'))
--
2.43.0
next prev parent reply other threads:[~2023-12-31 8:50 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-31 8:44 [PULL 00/46] (mostly) target/i386 and meson changes for 2023-12-31 Paolo Bonzini
2023-12-31 8:44 ` [PULL 01/46] configure: use a native non-cross compiler for linux-user Paolo Bonzini
2023-12-31 8:44 ` [PULL 02/46] target/i386: optimize computation of JL and JLE from flags Paolo Bonzini
2023-12-31 8:44 ` [PULL 03/46] target/i386: speedup JO/SETO after MUL or IMUL Paolo Bonzini
2023-12-31 8:44 ` [PULL 04/46] target/i386: remove unnecessary arguments from raise_interrupt Paolo Bonzini
2023-12-31 8:44 ` [PULL 05/46] target/i386: remove unnecessary truncations Paolo Bonzini
2023-12-31 8:44 ` [PULL 06/46] target/i386: clean up cpu_cc_compute_all Paolo Bonzini
2023-12-31 8:44 ` [PULL 07/46] target/i386: document more deviations from the manual Paolo Bonzini
2023-12-31 8:44 ` [PULL 08/46] target/i386: reimplement check for validity of LOCK prefix Paolo Bonzini
2023-12-31 8:44 ` [PULL 09/46] target/i386: avoid trunc and ext for MULX and RORX Paolo Bonzini
2023-12-31 8:44 ` [PULL 10/46] target/i386: rename zext0/zext2 and make them closer to the manual Paolo Bonzini
2023-12-31 8:44 ` [PULL 11/46] target/i386: add X86_SPECIALs for MOVSX and MOVZX Paolo Bonzini
2023-12-31 8:44 ` [PULL 12/46] target/i386: do not decode string source/destination into decode->mem Paolo Bonzini
2023-12-31 8:44 ` [PULL 13/46] target/i386: do not clobber A0 in POP translation Paolo Bonzini
2023-12-31 8:44 ` [PULL 14/46] target/i386: do not clobber T0 on string operations Paolo Bonzini
2023-12-31 8:44 ` [PULL 15/46] target/i386: split eflags computation out of gen_compute_eflags Paolo Bonzini
2023-12-31 8:44 ` [PULL 16/46] target/i386: do not use s->tmp4 for push Paolo Bonzini
2023-12-31 8:44 ` [PULL 17/46] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0 Paolo Bonzini
2023-12-31 8:44 ` [PULL 18/46] target/i386: prepare for implementation of STOS/SCAS in new decoder Paolo Bonzini
2023-12-31 8:44 ` [PULL 19/46] target/i386: move operand load and writeback out of gen_cmovcc1 Paolo Bonzini
2023-12-31 8:44 ` [PULL 20/46] target/i386: adjust decoding of J operand Paolo Bonzini
2023-12-31 8:44 ` [PULL 21/46] target/i386: introduce flags writeback mechanism Paolo Bonzini
2023-12-31 8:44 ` [PULL 22/46] target/i386: implement CMPccXADD Paolo Bonzini
2023-12-31 8:44 ` [PULL 23/46] target/i386: the sgx_epc_get_section stub is reachable Paolo Bonzini
2023-12-31 8:44 ` [PULL 24/46] esp: check for NULL result from scsi_device_find() Paolo Bonzini
2023-12-31 8:44 ` [PULL 25/46] meson: fix type of "relocatable" option Paolo Bonzini
2023-12-31 8:44 ` [PULL 26/46] meson: remove unused variable Paolo Bonzini
2023-12-31 8:44 ` [PULL 27/46] meson: use version_compare() to compare version Paolo Bonzini
2023-12-31 8:44 ` [PULL 28/46] Makefile: clean qemu-iotests output Paolo Bonzini
2023-12-31 8:44 ` [PULL 29/46] configure: remove unnecessary subshell Paolo Bonzini
2023-12-31 8:44 ` [PULL 30/46] configure: unify again the case arms in probe_target_compiler Paolo Bonzini
2023-12-31 8:44 ` [PULL 31/46] meson: add more sections to main meson.build Paolo Bonzini
2023-12-31 8:44 ` [PULL 32/46] meson: move program checks together Paolo Bonzini
2023-12-31 8:44 ` [PULL 33/46] meson: move option validation together Paolo Bonzini
2023-12-31 8:44 ` [PULL 34/46] meson: move accelerator dependency checks together Paolo Bonzini
2023-12-31 8:44 ` [PULL 35/46] meson: keep subprojects together Paolo Bonzini
2023-12-31 8:44 ` [PULL 36/46] meson: move CFI detection code with other compiler flags Paolo Bonzini
2023-12-31 8:44 ` [PULL 37/46] meson: move config-host.h definitions together Paolo Bonzini
2023-12-31 8:44 ` [PULL 38/46] meson: move subdirs to "Collect sources" section Paolo Bonzini
2023-12-31 8:44 ` [PULL 39/46] meson: always probe u2f and canokey if the option is enabled Paolo Bonzini
2023-12-31 8:44 ` [PULL 40/46] meson: remove OS definitions from config_targetos Paolo Bonzini
2023-12-31 8:44 ` Paolo Bonzini [this message]
2023-12-31 8:44 ` [PULL 42/46] meson: remove config_targetos Paolo Bonzini
2023-12-31 8:44 ` [PULL 43/46] meson: remove CONFIG_ALL Paolo Bonzini
2023-12-31 8:45 ` [PULL 44/46] meson: rename config_all Paolo Bonzini
2023-12-31 8:45 ` [PULL 45/46] configure, meson: rename targetos to host_os Paolo Bonzini
2023-12-31 8:45 ` [PULL 46/46] meson.build: report graphics backends separately Paolo Bonzini
2024-01-05 12:53 ` [PULL 00/46] (mostly) target/i386 and meson changes for 2023-12-31 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231231084502.235366-42-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).