aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAlexander Graf <graf@amazon.com>2023-08-30 16:14:14 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-08-31 19:47:43 +0200
commit2fc36530dec61eb83c73f5684a0e8f55a0b9a4d1 (patch)
tree792d01a8ce85035d9cdcc587a82b03c939c59bb0 /meson.build
parent0b2d8bd698517efb147d47cefc252ae0d2c984e3 (diff)
build: Only define OS_OBJECT_USE_OBJC with gcc
Recent versions of macOS use clang instead of gcc. The OS_OBJECT_USE_OBJC define is only necessary when building with gcc. Let's not define it when building with clang. With this patch, I can successfully include GCD headers in QEMU when building with clang. Signed-off-by: Alexander Graf <graf@amazon.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20230830161425.91946-2-graf@amazon.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index ec14079c67..296f6ef1d2 100644
--- a/meson.build
+++ b/meson.build
@@ -223,7 +223,9 @@ qemu_ldflags = []
if targetos == 'darwin'
# Disable attempts to use ObjectiveC features in os/object.h since they
# won't work when we're compiling with gcc as a C compiler.
- qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0'
+ if compiler.get_id() == 'gcc'
+ qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0'
+ endif
elif targetos == 'solaris'
# needed for CMSG_ macros in sys/socket.h
qemu_common_flags += '-D_XOPEN_SOURCE=600'