From 20ea90a186748f34061fec323faa74f084c7937c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 17 Jan 2015 18:19:25 +0100 Subject: [PATCH] waf: fix concurrency issue with duplicate targets The same source file cannot safely be used in different wscripts with concurrency (if they were in the same wscript it works .c.1.o .c.2.o, etc). [387/764] c: libs/fst/vstwin.c -> build/libs/fst/vstwin.c.1.o [731/764] c: libs/fst/vstwin.c -> build/libs/fst/vstwin.c.1.o [746/764] cxxprogram: build/libs/fst/scanner.cc.1.o build/libs/fst/vstwin.c.1.o -> build/libs/fst/ardour-vst-scanner.exe [750/764] cxxshlib: [...] build/libs/fst/vstwin.c.1.o [...] -> build/libs/ardour/ardour-3.dll and about one every full moon (depending on concurrency) it failed: missing file: 'build/libs/fst/vstwin.c.1.o' --- gtk2_ardour/wscript | 8 +++----- libs/ardour/wscript | 2 +- libs/fst/wscript | 15 ++++++++------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 421b1be6a6..4e520ff5c4 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -368,10 +368,7 @@ def build(bld): # If we require VST support we build a stub main() and the FST library # here using winegcc, and link it to the GTK front-end library obj = bld (features = 'cxx c cxxprogram wine') - obj.source = ( - '../libs/fst/vstwin.c', - '../vst/winmain.c', - ) + obj.source = ( '../vst/winmain.c') # # XXX do we really need to explicitly link to all of these for the wine executable? # @@ -383,7 +380,8 @@ def build(bld): 'libmidipp', 'libgtk2_ardour', 'libgtkmm2ext', - 'libcanvas' + 'libcanvas', + 'vstwin' ] obj.target = 'ardour-' + str (bld.env['VERSION']) + '-vst.exe.so' obj.includes = [ '../libs/fst', '.' ] diff --git a/libs/ardour/wscript b/libs/ardour/wscript index dadea20645..f1167e8611 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -382,7 +382,7 @@ def build(bld): obj.includes += [ '../fst' ] obj.defines += [ 'WINDOWS_VST_SUPPORT' ] if bld.env['build_target'] == 'mingw': - obj.source += [ '../fst/vstwin.c'] + obj.use += [ 'vstwin' ] obj.uselib += ['GDI32'] if bld.is_defined('LXVST_SUPPORT'): diff --git a/libs/fst/wscript b/libs/fst/wscript index 3e4605837d..b307bfa4b8 100644 --- a/libs/fst/wscript +++ b/libs/fst/wscript @@ -68,14 +68,15 @@ def build(bld): obj.use = [ 'libpbd' ] else: obj = bld (features = 'cxx c cxxprogram') - if bld.is_defined('WINDOWS_VST_SUPPORT'): - obj.source = ( 'scanner.cc', 'vstwin.c' ) - obj.uselib = ['GIOMM', 'DL', 'GDI32'] - else: - obj.source = ( 'scanner.cc' ) - obj.uselib = ['GIOMM', 'DL'] + obj.source = ( 'scanner.cc' ) obj.target = 'ardour-vst-scanner' - obj.use = [ 'libpbd' ] + if bld.is_defined('WINDOWS_VST_SUPPORT'): + bld (features = 'c', name='vstwin', source='vstwin.c', uselib = 'GIOMM', includes = [ '../pbd/', '../ardour/', '.' ]) + obj.uselib = ['GIOMM', 'DL', 'GDI32'] + obj.use = [ 'libpbd', 'vstwin' ] + else: + obj.uselib = ['GIOMM', 'DL'] + obj.use = [ 'libpbd' ] obj.includes = [ '../pbd/', '../ardour/', '.' ] obj.defines = [