make copies of global lists before extending

Not doing so can make source or object files appear multiple times in
the list of files to be compiled or linked, e.g. when doing './waf build
install', subsequently leading to linker errors.
This commit is contained in:
Nils Philippsen 2015-11-23 13:52:14 +01:00 committed by Paul Davis
parent 4d599b3da1
commit e25ddc39f8
3 changed files with 8 additions and 4 deletions

View file

@ -422,7 +422,8 @@ def build(bld):
# now the shared library containing the GTK GUI for ardour
obj = bld (features = 'cxx c cxxshlib')
obj.source = gtk2_ardour_sources
# operate on copy to avoid adding sources twice
obj.source = list(gtk2_ardour_sources)
obj.includes = [ '../libs/fst', '.' ]
obj.name = 'libgtk2_ardour'
obj.target = 'gtk2_ardour'
@ -433,7 +434,8 @@ def build(bld):
obj = bld (features = 'cxx c cxxprogram winres')
else:
obj = bld (features = 'cxx c cxxprogram')
obj.source = gtk2_ardour_sources
# operate on copy to avoid adding sources twice
obj.source = list(gtk2_ardour_sources)
obj.target = 'ardour-' + str (bld.env['VERSION'])
obj.includes = ['.']
obj.ldflags = ['-no-undefined']