1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

build: prefer C11 mode

C99 still works, but in theory we're using C11 features already, such as
stdatomic.h. gcc/clang let us use it in C99 mode too, but using C11 is
at least more proper.
This commit is contained in:
wm4 2018-05-20 23:33:07 +02:00
parent 1ebc72d05c
commit 5ae271e4f4

View File

@ -20,7 +20,12 @@ def __add_generic_flags__(ctx):
ctx.env.CFLAGS += ["-D_ISOC99_SOURCE", "-D_GNU_SOURCE",
"-D_LARGEFILE_SOURCE", "-D_FILE_OFFSET_BITS=64",
"-D_LARGEFILE64_SOURCE",
"-std=c99", "-Wall"]
"-Wall"]
if ctx.check_cc(cflags="-std=c11", mandatory=False):
ctx.env.CFLAGS += ["-std=c11"]
else:
ctx.env.CFLAGS += ["-std=c99"]
if ctx.is_optimization():
ctx.env.CFLAGS += ['-O2']