mirror of https://github.com/mpv-player/mpv
build: enable compiler optimization by default
This commit is contained in:
parent
887140b7d4
commit
b0ff0527a3
|
@ -22,6 +22,9 @@ def __add_generic_flags__(ctx):
|
||||||
"-D_LARGEFILE64_SOURCE",
|
"-D_LARGEFILE64_SOURCE",
|
||||||
"-std=c99", "-Wall"]
|
"-std=c99", "-Wall"]
|
||||||
|
|
||||||
|
if ctx.is_optimization():
|
||||||
|
ctx.env.CFLAGS += ['-O2']
|
||||||
|
|
||||||
if ctx.is_debug_build():
|
if ctx.is_debug_build():
|
||||||
ctx.env.CFLAGS += ['-g']
|
ctx.env.CFLAGS += ['-g']
|
||||||
|
|
||||||
|
|
9
wscript
9
wscript
|
@ -35,6 +35,11 @@ build_options = [
|
||||||
'desc': 'whether to include binary compile time',
|
'desc': 'whether to include binary compile time',
|
||||||
'default': 'enable',
|
'default': 'enable',
|
||||||
'func': check_true
|
'func': check_true
|
||||||
|
}, {
|
||||||
|
'name': '--optimize',
|
||||||
|
'desc': 'whether to optimize',
|
||||||
|
'default': 'enable',
|
||||||
|
'func': check_true
|
||||||
}, {
|
}, {
|
||||||
'name': '--debug-build',
|
'name': '--debug-build',
|
||||||
'desc': 'whether to compile-in debugging information',
|
'desc': 'whether to compile-in debugging information',
|
||||||
|
@ -787,6 +792,10 @@ def options(opt):
|
||||||
dest = 'LUA_VER',
|
dest = 'LUA_VER',
|
||||||
help = "select Lua package which should be autodetected. Choices: 51 51deb 51fbsd 52 52deb 52fbsd luajit")
|
help = "select Lua package which should be autodetected. Choices: 51 51deb 51fbsd 52 52deb 52fbsd luajit")
|
||||||
|
|
||||||
|
@conf
|
||||||
|
def is_optimization(ctx):
|
||||||
|
return getattr(ctx.options, 'enable_optimize')
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def is_debug_build(ctx):
|
def is_debug_build(ctx):
|
||||||
return getattr(ctx.options, 'enable_debug-build')
|
return getattr(ctx.options, 'enable_debug-build')
|
||||||
|
|
Loading…
Reference in New Issue