waf: fix concurrency issue with duplicate targets
authorRobin Gareus <robin@gareus.org>
Sat, 17 Jan 2015 17:19:25 +0000 (18:19 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 17 Jan 2015 17:19:25 +0000 (18:19 +0100)
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
libs/ardour/wscript
libs/fst/wscript

index 421b1be6a6d62a6b660721b6cdc9d95a4fe5b598..4e520ff5c4d7d2947236aa6f10602bde327035ef 100644 (file)
@@ -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', '.' ]
index dadea206459b92013521610593b8f61878037c05..f1167e8611cb065eeb74fe066522d443a56aca32 100644 (file)
@@ -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'):
index 3e4605837d9382ec7e389ba60ef3c133368d0815..b307bfa4b8fb52d7209d2152e4dcc6d24047eede 100644 (file)
@@ -68,14 +68,15 @@ def build(bld):
         obj.use = [ 'libpbd' ]
     else:
         obj = bld (features = 'cxx c cxxprogram')
+        obj.source = ( 'scanner.cc' )
+        obj.target = 'ardour-vst-scanner'
         if bld.is_defined('WINDOWS_VST_SUPPORT'):
-            obj.source = ( 'scanner.cc', 'vstwin.c' )
+            bld (features = 'c', name='vstwin', source='vstwin.c', uselib = 'GIOMM', includes  = [ '../pbd/', '../ardour/', '.' ])
             obj.uselib = ['GIOMM', 'DL', 'GDI32']
+            obj.use = [ 'libpbd', 'vstwin' ]
         else:
-            obj.source = ( 'scanner.cc' )
             obj.uselib = ['GIOMM', 'DL']
-        obj.target = 'ardour-vst-scanner'
-        obj.use = [ 'libpbd' ]
+            obj.use = [ 'libpbd' ]
 
     obj.includes  = [ '../pbd/', '../ardour/', '.' ]
     obj.defines = [