13
0
livetrax/libs/fst/wscript
Robin Gareus 20ea90a186 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'
2015-01-17 18:19:25 +01:00

90 lines
2.7 KiB
Python

#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
from waflib import Options, TaskGen
import waflib.Logs as Logs, waflib.Utils as Utils
import os
import shutil
import sys
import re
import time
from waflib.Task import Task
# Mandatory variables
top = '.'
out = 'build'
scanner_app_src = [
'scanner.cc',
]
# needed for code used from libardour
I18N_PACKAGE = 'ardour'
def options(opt):
autowaf.set_options(opt)
def configure(conf):
conf.load('misc')
conf.load('compiler_cxx')
autowaf.configure(conf)
if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
conf.check(compiler='cxx',
lib='gdi32',
mandatory=True,
uselib_store='GDI32')
# Add a waf `feature' to allow compilation of things using winegcc
from waflib.TaskGen import feature
@feature("wine")
def set_winegcc(self):
self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
self.env.CC = 'winegcc'
def build(bld):
VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
if not (bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT')):
return
if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
# wine exec wrapper script
obj = bld(features = 'subst')
obj.source = 'scanner.wine'
obj.target = 'ardour-vst-scanner'
obj.chmod = Utils.O755
obj.install_path = os.path.join(bld.env['LIBDIR'])
obj.dict = {
'VERSION' : bld.env['VERSION'],
}
obj = bld (features = 'c cxx cxxprogram wine')
obj.source = (
'scanner.cc',
'vstwin.c',
)
obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
obj.linkflags += bld.env['LDFLAGS']
obj.target = 'ardour-vst-scanner.exe.so'
obj.uselib = ['GIOMM', 'DL']
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'):
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 = [
'_POSIX_SOURCE',
'USE_WS_PREFIX',
'VST_SCANNER_APP',
'PACKAGE="' + I18N_PACKAGE + str(bld.env['MAJOR']) + '"',
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',
]
obj.install_path = os.path.join(bld.env['LIBDIR'])