cleanup unnecessary builder function and flags in SCons build
This commit is contained in:
parent
34f2de641f
commit
08d330310f
4 changed files with 16 additions and 26 deletions
11
SConstruct
11
SConstruct
|
|
@ -332,10 +332,10 @@ def defineBuildTargets(env, artifacts):
|
||||||
We use a custom function to declare a whole tree of srcfiles.
|
We use a custom function to declare a whole tree of srcfiles.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
lLib = env.SharedLibrary('lumiera', srcSubtree(env,'src/lib'), install=True)
|
lLib = env.SharedLibrary('lumiera', srcSubtree('src/lib'), install=True)
|
||||||
lApp = env.SharedLibrary('lumieracommon', srcSubtree(env,'src/common'), install=True, LIBS=lLib)
|
lApp = env.SharedLibrary('lumieracommon', srcSubtree('src/common'), install=True, LIBS=lLib)
|
||||||
lBack = env.SharedLibrary('lumierabackend', srcSubtree(env,'src/backend'),install=True)
|
lBack = env.SharedLibrary('lumierabackend', srcSubtree('src/backend'),install=True)
|
||||||
lProc = env.SharedLibrary('lumieraproc', srcSubtree(env,'src/proc'), install=True)
|
lProc = env.SharedLibrary('lumieraproc', srcSubtree('src/proc'), install=True)
|
||||||
|
|
||||||
core = lLib+lApp+lBack+lProc
|
core = lLib+lApp+lBack+lProc
|
||||||
|
|
||||||
|
|
@ -363,8 +363,7 @@ def defineBuildTargets(env, artifacts):
|
||||||
envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm'])
|
envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm'])
|
||||||
envGtk.Append(LIBS=core)
|
envGtk.Append(LIBS=core)
|
||||||
|
|
||||||
objgui = srcSubtree(envGtk,'src/gui', appendCPP='LUMIERA_PLUGIN')
|
guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('src/gui'), install=True)
|
||||||
guimodule = envGtk.LumieraPlugin('gtk_gui', objgui, install=True)
|
|
||||||
artifacts['gui'] = ( guimodule
|
artifacts['gui'] = ( guimodule
|
||||||
+ [env.GuiResource(f) for f in env.Glob('src/gui/*.rc')]
|
+ [env.GuiResource(f) for f in env.Glob('src/gui/*.rc')]
|
||||||
+ artifacts['icons']
|
+ artifacts['icons']
|
||||||
|
|
|
||||||
|
|
@ -49,20 +49,11 @@ def isHelpRequest():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def srcSubtree(env,tree,isShared=True,builder=None,appendCPP=None, **args):
|
def srcSubtree(tree, **args):
|
||||||
""" convenience wrapper: scans the given subtree, which is
|
""" convenience wrapper: scan the given subtree, which is relative
|
||||||
relative to the current SConscript, find all source files and
|
to the current SConscript, and find all source files.
|
||||||
declare them as Static or SharedObjects for compilation
|
|
||||||
"""
|
"""
|
||||||
if appendCPP: env.Append(CPPDEFINES=appendCPP)
|
return list(scanSubtree(tree, **args))
|
||||||
root = env.subst(tree) # expand Construction Vars
|
|
||||||
if not builder:
|
|
||||||
if isShared:
|
|
||||||
builder = lambda f: env.SharedObject(f, **args)
|
|
||||||
else:
|
|
||||||
builder = lambda f: env.Object(f, **args)
|
|
||||||
|
|
||||||
return [builder(f) for f in scanSubtree(root)]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -161,7 +152,7 @@ def createPlugins(env, dir, **kw):
|
||||||
@return: a list of build nodes defining a plugin for each of these source trees.
|
@return: a list of build nodes defining a plugin for each of these source trees.
|
||||||
"""
|
"""
|
||||||
return [env.LumieraPlugin( getDirname(tree)
|
return [env.LumieraPlugin( getDirname(tree)
|
||||||
, srcSubtree(env, tree, appendCPP='LUMIERA_PLUGIN')
|
, srcSubtree(tree)
|
||||||
, **kw
|
, **kw
|
||||||
)
|
)
|
||||||
for tree in findSrcTrees(dir)
|
for tree in findSrcTrees(dir)
|
||||||
|
|
|
||||||
|
|
@ -205,8 +205,8 @@ def register_LumieraResourceBuilder(env):
|
||||||
class WrappedStandardExeBuilder(SCons.Util.Proxy):
|
class WrappedStandardExeBuilder(SCons.Util.Proxy):
|
||||||
""" Helper to add customisations and default configurations to SCons standard builders.
|
""" Helper to add customisations and default configurations to SCons standard builders.
|
||||||
The original builder object is wrapped and most calls are simply forwarded to this
|
The original builder object is wrapped and most calls are simply forwarded to this
|
||||||
wrapped object by Python magic. But some calls are intecepted in order to inject
|
wrapped object by Python magic. But some calls are intercepted in order to inject
|
||||||
suitalbe default configuration based on the project setup.
|
suitable default configuration based on the project setup.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, originalBuilder):
|
def __init__(self, originalBuilder):
|
||||||
|
|
@ -291,7 +291,7 @@ class LumieraModuleBuilder(WrappedStandardExeBuilder):
|
||||||
explicit spec, falling back on the lib filename
|
explicit spec, falling back on the lib filename
|
||||||
"""
|
"""
|
||||||
if 'soname' in kw:
|
if 'soname' in kw:
|
||||||
soname = self.subst(kw['soname']) # explicitely defined by user
|
soname = self.subst(kw['soname']) # explicitly defined by user
|
||||||
else: # else: use the library filename as DT_SONAME
|
else: # else: use the library filename as DT_SONAME
|
||||||
if SCons.Util.is_String(target):
|
if SCons.Util.is_String(target):
|
||||||
pathname = target.strip()
|
pathname = target.strip()
|
||||||
|
|
@ -331,7 +331,7 @@ class LumieraPluginBuilder(LumieraModuleBuilder):
|
||||||
|
|
||||||
|
|
||||||
def register_LumieraCustomBuilders (lumiEnv):
|
def register_LumieraCustomBuilders (lumiEnv):
|
||||||
""" install the customised builder versions tightly integrated with our buildsystem.
|
""" install the customised builder versions tightly integrated with our build system.
|
||||||
Especially, these builders automatically add the build and installation locations
|
Especially, these builders automatically add the build and installation locations
|
||||||
and set the RPATH and SONAME in a way to allow a relocatable Lumiera directory structure
|
and set the RPATH and SONAME in a way to allow a relocatable Lumiera directory structure
|
||||||
"""
|
"""
|
||||||
|
|
@ -362,7 +362,7 @@ def register_LumieraCustomBuilders (lumiEnv):
|
||||||
action = Action(makeLink, "Install link: $TARGET -> "+srcSpec)
|
action = Action(makeLink, "Install link: $TARGET -> "+srcSpec)
|
||||||
env.Command (target,source, action)
|
env.Command (target,source, action)
|
||||||
|
|
||||||
# adding SymLink direclty as method on the environment object
|
# adding SymLink directly as method on the environment object
|
||||||
# Probably that should better be a real builder, but I couldn't figure out
|
# Probably that should better be a real builder, but I couldn't figure out
|
||||||
# how to get the linktext through literally, which is necessary for relative links.
|
# how to get the linktext through literally, which is necessary for relative links.
|
||||||
# Judging from the sourcecode of SCons.Builder.BuilderBase, there seems to be no way
|
# Judging from the sourcecode of SCons.Builder.BuilderBase, there seems to be no way
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ def testExecutable(env,tree, exeName=None, obj=None):
|
||||||
if obj:
|
if obj:
|
||||||
obj = [path.join(tree,name) for name in obj]
|
obj = [path.join(tree,name) for name in obj]
|
||||||
else:
|
else:
|
||||||
obj = srcSubtree(env,tree, isShared=False) # use all sourcefiles found in subtree
|
obj = srcSubtree(tree) # use all sourcefiles found in subtree
|
||||||
if not exeName:
|
if not exeName:
|
||||||
exeName = 'test-%s' % tree
|
exeName = 'test-%s' % tree
|
||||||
return env.Program(exeName, obj + core)
|
return env.Program(exeName, obj + core)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue