diff options
author | Timm Bäder <tbaeder@redhat.com> | 2021-01-08 14:32:07 +0100 |
---|---|---|
committer | Timm Bäder <tbaeder@redhat.com> | 2021-01-08 14:32:31 +0100 |
commit | 8190f1db7960877dc04821ba21f25249674b2628 (patch) | |
tree | 7e4f02fca8847b702f868e1ce85c3a8950dbf9ea | |
parent | fd77555a29a4c3d806acbaf829c006bf6a9dd5ac (diff) | |
download | libosinfo-8190f1db7960877dc04821ba21f25249674b2628.tar.gz |
build: Move bsd/mac checks to be compiler-specific
They depend on the compiler in use, not the operating system
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
-rw-r--r-- | meson.build | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meson.build b/meson.build index e8d9a19..db1a4f7 100644 --- a/meson.build +++ b/meson.build @@ -233,8 +233,10 @@ if host_machine.system() == 'linux' libosinfo_check_cflags += ['-fstack-protector-all'] endif -# Builds os macOS and BSDs will fail without those. -if host_machine.system() != 'linux' +compiler = meson.get_compiler('c') + +# Builds os clang will fail without those. +if compiler.get_id() == 'clang' libosinfo_check_cflags += [ '-Wno-typedef-redefinition', '-Wno-missing-field-initializers', @@ -245,7 +247,6 @@ if run_command('[', '-d', '.git', ']').returncode() == 0 libosinfo_check_cflags += ['-Werror'] endif -compiler = meson.get_compiler('c') foreach cflag: libosinfo_check_cflags if compiler.has_argument(cflag) libosinfo_cflags += [cflag] |