aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-20 17:33:50 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-07 07:46:58 +0200
commitd2147e04f95f24d0535bba600b95be2676558367 (patch)
tree8f7fdf2e5dc89bb0f9706d853d8056937af3f629 /meson.build
parent40c909f534e3f3cd2bcb797b95f96d52e6dd5cdf (diff)
configure: move Windows flags detection to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build8
1 files changed, 8 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 448a8dd2a4..6606c9790f 100644
--- a/meson.build
+++ b/meson.build
@@ -182,6 +182,14 @@ qemu_cxxflags = config_host['QEMU_CXXFLAGS'].split()
qemu_objcflags = config_host['QEMU_OBJCFLAGS'].split()
qemu_ldflags = config_host['QEMU_LDFLAGS'].split()
+if targetos == 'windows'
+ qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-seh', '-Wl,--nxcompat')
+ # Disable ASLR for debug builds to allow debugging with gdb
+ if get_option('optimization') == '0'
+ qemu_ldflags += cc.get_supported_link_arguments('-Wl,--dynamicbase')
+ endif
+endif
+
if get_option('gprof')
qemu_cflags += ['-p']
qemu_cxxflags += ['-p']