aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-09-01 07:45:54 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-08 11:43:16 +0200
commit201e8ed7df00cffe6df967bd42903c1cbcecd721 (patch)
tree5a0526c53a9b004773865b47f1b2072036665d46 /meson.build
parentca0fc78431fb313cba7c23a38ad7af092a73e06a (diff)
meson: keep all compiler flags detection together
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build30
1 files changed, 17 insertions, 13 deletions
diff --git a/meson.build b/meson.build
index 6fbe79ae94..d619cd901e 100644
--- a/meson.build
+++ b/meson.build
@@ -32,6 +32,23 @@ endforeach
have_tools = 'CONFIG_TOOLS' in config_host
have_block = have_system or have_tools
+python = import('python').find_installation()
+
+supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
+supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
+ 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
+
+cpu = host_machine.cpu_family()
+targetos = host_machine.system()
+
+configure_file(input: files('scripts/ninjatool.py'),
+ output: 'ninjatool',
+ configuration: config_host)
+
+##################
+# Compiler flags #
+##################
+
add_project_arguments(config_host['QEMU_CFLAGS'].split(),
native: false, language: ['c', 'objc'])
add_project_arguments(config_host['QEMU_CXXFLAGS'].split(),
@@ -41,8 +58,6 @@ add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
add_project_arguments(config_host['QEMU_INCLUDES'].split(),
language: ['c', 'cpp', 'objc'])
-python = import('python').find_installation()
-
link_language = meson.get_external_property('link_language', 'cpp')
if link_language == 'cpp'
add_languages('cpp', required: true, native: false)
@@ -58,17 +73,6 @@ if 'SPARSE_CFLAGS' in config_host
'compile_commands.json'])
endif
-configure_file(input: files('scripts/ninjatool.py'),
- output: 'ninjatool',
- configuration: config_host)
-
-supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
-supported_cpus = ['ppc', 'ppc64', 's390x', 'sparc64', 'riscv32', 'riscv64', 'x86', 'x86_64',
- 'arm', 'aarch64', 'mips', 'mips64', 'sparc', 'sparc64']
-
-cpu = host_machine.cpu_family()
-targetos = host_machine.system()
-
m = cc.find_library('m', required: false)
util = cc.find_library('util', required: false)
winmm = []