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

Loading…
Cancel
Save