diff --git a/SConstruct b/SConstruct index aa382f2c8..717609d76 100644 --- a/SConstruct +++ b/SConstruct @@ -90,7 +90,7 @@ def setupBasicEnvironment(localDefinitions): env.Append ( CCCOM=' -std=gnu99') env.Append ( SHCCCOM=' -std=gnu99') # workaround for a bug: CCCOM currently doesn't honour CFLAGS, only CCFLAGS env.Replace( CPPPATH =["#src"] # used to find includes, "#" means always absolute to build-root - , CPPDEFINES=['-DLUMIERA_VERSION='+VERSION ] # note: it's a list to append further defines + , CPPDEFINES=['LUMIERA_VERSION='+VERSION ] # note: it's a list to append further defines , CCFLAGS='-Wall -Wextra ' , CFLAGS='-std=gnu99' ) @@ -367,7 +367,7 @@ def defineBuildTargets(env, artifacts): envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm']) envGtk.Append(LIBS=core) - objgui = srcSubtree(envGtk,'src/gui') + objgui = srcSubtree(envGtk,'src/gui', appendCPP='LUMIERA_PLUGIN') guimodule = envGtk.LumieraPlugin('gtk_gui', objgui, install=True) artifacts['gui'] = ( guimodule + [env.GuiResource(f) for f in env.Glob('src/gui/*.rc')] diff --git a/admin/scons/Buildhelper.py b/admin/scons/Buildhelper.py index aed9c07da..69fb3849d 100644 --- a/admin/scons/Buildhelper.py +++ b/admin/scons/Buildhelper.py @@ -49,11 +49,12 @@ def isHelpRequest(): -def srcSubtree(env,tree,isShared=True,builder=None, **args): +def srcSubtree(env,tree,isShared=True,builder=None,appendCPP=None, **args): """ convenience wrapper: scans the given subtree, which is relative to the current SConscript, find all source files and declare them as Static or SharedObjects for compilation """ + if appendCPP: env.Append(CPPDEFINES=appendCPP) root = env.subst(tree) # expand Construction Vars if not builder: if isShared: @@ -160,7 +161,7 @@ def createPlugins(env, dir, **kw): @return: a list of build nodes defining a plugin for each of these source trees. """ return [env.LumieraPlugin( getDirname(tree) - , srcSubtree(env, tree) + , srcSubtree(env, tree, appendCPP='LUMIERA_PLUGIN') , **kw ) for tree in findSrcTrees(dir) diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py index 82a89b6ae..28b1eb48f 100644 --- a/admin/scons/LumieraEnvironment.py +++ b/admin/scons/LumieraEnvironment.py @@ -185,6 +185,8 @@ class WrappedStandardExeBuilder(SCons.Util.Proxy): def __init__(self, originalBuilder): SCons.Util.Proxy.__init__ (self, originalBuilder) + def __nonzero__(self): return True + def __call__(self, env, target=None, source=None, **kw): """ when the builder gets invoked from the SConscript... create a clone environment for specific configuration