mirror of https://github.com/mpv-player/mpv
build: optimise adding additional objects for linking
splitting the string by spaces isn't the best idea, so we use a proper list instead now.
This commit is contained in:
parent
e3972746dc
commit
9e52d36962
|
@ -96,8 +96,8 @@ def __wayland_protocol_header__(ctx, **kwargs):
|
||||||
@TaskGen.feature('apply_link')
|
@TaskGen.feature('apply_link')
|
||||||
@TaskGen.after_method('process_source', 'process_use', 'apply_link', 'process_uselib_local', 'propagate_uselib_vars', 'do_the_symbol_stuff')
|
@TaskGen.after_method('process_source', 'process_use', 'apply_link', 'process_uselib_local', 'propagate_uselib_vars', 'do_the_symbol_stuff')
|
||||||
def handle_add_object(tgen):
|
def handle_add_object(tgen):
|
||||||
if getattr(tgen, 'add_object', None):
|
if getattr(tgen, 'add_objects', None):
|
||||||
for input in Utils.to_list(tgen.add_object):
|
for input in tgen.add_objects:
|
||||||
input_node = tgen.path.find_resource(input)
|
input_node = tgen.path.find_resource(input)
|
||||||
if input_node is not None:
|
if input_node is not None:
|
||||||
tgen.link_task.inputs.append(input_node)
|
tgen.link_task.inputs.append(input_node)
|
||||||
|
|
|
@ -580,16 +580,16 @@ def build(ctx):
|
||||||
syms = True
|
syms = True
|
||||||
ctx.load("syms")
|
ctx.load("syms")
|
||||||
|
|
||||||
additonal_objects = ""
|
additional_objects = []
|
||||||
if ctx.dependency_satisfied('swift'):
|
if ctx.dependency_satisfied('swift'):
|
||||||
additonal_objects = "osdep/macOS_swift.o"
|
additional_objects.append("osdep/macOS_swift.o")
|
||||||
|
|
||||||
if ctx.dependency_satisfied('cplayer'):
|
if ctx.dependency_satisfied('cplayer'):
|
||||||
ctx(
|
ctx(
|
||||||
target = "mpv",
|
target = "mpv",
|
||||||
source = main_fn_c,
|
source = main_fn_c,
|
||||||
use = ctx.dependencies_use() + ['objects'],
|
use = ctx.dependencies_use() + ['objects'],
|
||||||
add_object = additonal_objects,
|
add_objects = additional_objects,
|
||||||
includes = _all_includes(ctx),
|
includes = _all_includes(ctx),
|
||||||
features = "c cprogram" + (" syms" if syms else ""),
|
features = "c cprogram" + (" syms" if syms else ""),
|
||||||
export_symbols_def = "libmpv/mpv.def", # for syms=True
|
export_symbols_def = "libmpv/mpv.def", # for syms=True
|
||||||
|
@ -646,7 +646,7 @@ def build(ctx):
|
||||||
"target": "mpv",
|
"target": "mpv",
|
||||||
"source": ctx.filtered_sources(sources),
|
"source": ctx.filtered_sources(sources),
|
||||||
"use": ctx.dependencies_use(),
|
"use": ctx.dependencies_use(),
|
||||||
"add_object": additonal_objects,
|
"add_objects": additional_objects,
|
||||||
"includes": [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
|
"includes": [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
|
||||||
ctx.dependencies_includes(),
|
ctx.dependencies_includes(),
|
||||||
"features": features,
|
"features": features,
|
||||||
|
|
Loading…
Reference in New Issue