build: don't add swift object when swift disabled

This commit is contained in:
der richter 2019-09-20 12:35:54 +02:00 committed by Stefano Pigozzi
parent 600824494d
commit 511a73c5ce
1 changed files with 6 additions and 2 deletions

View File

@ -580,12 +580,16 @@ def build(ctx):
syms = True
ctx.load("syms")
additonal_objects = ""
if ctx.dependency_satisfied('swift'):
additonal_objects = "osdep/macOS_swift.o"
if ctx.dependency_satisfied('cplayer'):
ctx(
target = "mpv",
source = main_fn_c,
use = ctx.dependencies_use() + ['objects'],
add_object = "osdep/macOS_swift.o",
add_object = additonal_objects,
includes = _all_includes(ctx),
features = "c cprogram" + (" syms" if syms else ""),
export_symbols_def = "libmpv/mpv.def", # for syms=True
@ -642,7 +646,7 @@ def build(ctx):
"target": "mpv",
"source": ctx.filtered_sources(sources),
"use": ctx.dependencies_use(),
"add_object": "osdep/macOS_swift.o",
"add_object": additonal_objects,
"includes": [ctx.bldnode.abspath(), ctx.srcnode.abspath()] + \
ctx.dependencies_includes(),
"features": features,