Test compiler arguments for the appropriate compiler

MSVC does not expose GCC-compatible compiler arguments, so there's no
point in even trying.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent d35870f3b6
commit 37eaaada97
  1. 71
      meson.build

@ -73,39 +73,44 @@ endif
conf.set10('ENABLE_GLX', build_glx)
# Compiler flags, taken from the Xorg macros
test_cflags = [
'-Wpointer-arith',
'-Wmissing-declarations',
'-Wformat=2',
'-Wstrict-prototypes',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wbad-function-cast',
'-Wold-style-definition',
'-Wdeclaration-after-statement',
'-Wunused',
'-Wuninitialized',
'-Wshadow',
'-Wmissing-noreturn',
'-Wmissing-format-attribute',
'-Wredundant-decls',
'-Wlogical-op',
'-Werror=implicit',
'-Werror=nonnull',
'-Werror=init-self',
'-Werror=main',
'-Werror=missing-braces',
'-Werror=sequence-point',
'-Werror=return-type',
'-Werror=trigraphs',
'-Werror=array-bounds',
'-Werror=write-strings',
'-Werror=address',
'-Werror=int-to-pointer-cast',
'-Werror=pointer-to-int-cast',
'-fno-strict-aliasing',
'-Wno-int-conversion',
]
if cc.get_id() != 'msvc'
test_cflags = [
'-Wpointer-arith',
'-Wmissing-declarations',
'-Wformat=2',
'-Wstrict-prototypes',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wbad-function-cast',
'-Wold-style-definition',
'-Wdeclaration-after-statement',
'-Wunused',
'-Wuninitialized',
'-Wshadow',
'-Wmissing-noreturn',
'-Wmissing-format-attribute',
'-Wredundant-decls',
'-Wlogical-op',
'-Werror=implicit',
'-Werror=nonnull',
'-Werror=init-self',
'-Werror=main',
'-Werror=missing-braces',
'-Werror=sequence-point',
'-Werror=return-type',
'-Werror=trigraphs',
'-Werror=array-bounds',
'-Werror=write-strings',
'-Werror=address',
'-Werror=int-to-pointer-cast',
'-Werror=pointer-to-int-cast',
'-fno-strict-aliasing',
'-Wno-int-conversion',
]
else
test_cflags = []
endif
common_cflags = []
foreach cflag: test_cflags
if cc.has_argument(cflag)

Loading…
Cancel
Save