Skip to content

Commit

Permalink
build: optimise adding additional objects for linking
Browse files Browse the repository at this point in the history
splitting the string by spaces isn't the best idea, so we use a proper
list instead now.
  • Loading branch information
Akemi authored and jeeb committed Sep 22, 2019
1 parent e397274 commit 9e52d36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions waftools/generators/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def __wayland_protocol_header__(ctx, **kwargs):
@TaskGen.feature('apply_link')
@TaskGen.after_method('process_source', 'process_use', 'apply_link', 'process_uselib_local', 'propagate_uselib_vars', 'do_the_symbol_stuff')
def handle_add_object(tgen):
if getattr(tgen, 'add_object', None):
for input in Utils.to_list(tgen.add_object):
if getattr(tgen, 'add_objects', None):
for input in tgen.add_objects:
input_node = tgen.path.find_resource(input)
if input_node is not None:
tgen.link_task.inputs.append(input_node)
Expand Down
8 changes: 4 additions & 4 deletions wscript_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,16 +580,16 @@ def swift(task):
syms = True
ctx.load("syms")

additonal_objects = ""
additional_objects = []
if ctx.dependency_satisfied('swift'):
additonal_objects = "osdep/macOS_swift.o"
additional_objects.append("osdep/macOS_swift.o")

if ctx.dependency_satisfied('cplayer'):
ctx(
target = "mpv",
source = main_fn_c,
use = ctx.dependencies_use() + ['objects'],
add_object = additonal_objects,
add_objects = additional_objects,
includes = _all_includes(ctx),
features = "c cprogram" + (" syms" if syms else ""),
export_symbols_def = "libmpv/mpv.def", # for syms=True
Expand Down Expand Up @@ -646,7 +646,7 @@ def _build_libmpv(shared):
"target": "mpv",
"source": ctx.filtered_sources(sources),
"use": ctx.dependencies_use(),
"add_object": additonal_objects,
"add_objects": additional_objects,
"includes": [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
ctx.dependencies_includes(),
"features": features,
Expand Down

0 comments on commit 9e52d36

Please sign in to comment.