X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FSENFSCons.py;h=c2819199483c9e91a9835cdd014be81c047bbe15;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=4b32ae2b14504fea9ac50474a147adc58ed0353e;hpb=78c1f45585a8d7aecd3c29074f2733a3f6968396;p=senf.git diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 4b32ae2..c281919 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -49,6 +49,7 @@ import SCons.Defaults, SCons.Action SCONS_TOOLS = [ "Doxygen", "Dia2Png", + "CopyToDir", ] opts = None @@ -138,6 +139,7 @@ def FinalizeBoost(env): env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime env['BOOSTTESTLIB'] = 'libboost_unit_test_framework' + env['BOOST_VARIANT'] + env['BOOSTREGEXLIB'] = 'libboost_regex' + env['BOOST_VARIANT'] env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ]) @@ -244,9 +246,13 @@ def MakeEnvironment(): # in the current directory. The sources will be returned as a tuple of # sources, test-sources. The target helpers all accept such a tuple as # their source argument. -def GlobSources(exclude=[]): +def GlobSources(exclude=[], subdirs=[]): testSources = glob.glob("*.test.cc") sources = [ x for x in glob.glob("*.cc") if x not in testSources and x not in exclude ] + for subdir in subdirs: + testSources += glob.glob(os.path.join(subdir,"*.test.cc")) + sources += [ x for x in glob.glob(os.path.join(subdir,"*.cc")) + if x not in testSources and x not in exclude ] return (sources, testSources) ## \brief Add generic standard targets for every module @@ -296,16 +302,25 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = []): if type(sources) == type(()): testSources = sources[1] sources = sources[0] + if type(sources) is not type([]): + sources = [ sources ] objects = None if sources: - objects = env.Object(sources) + objects = env.Object([ + source + for source in sources + if not str(source).endswith('.o') ]) + [ + source + for source in sources + if str(source).endswith('.o') ] + if testSources: test = env.BoostUnitTests( target = 'test', - source = sources, - test_source = testSources, + objects = objects, + test_sources = testSources, LIBS = LIBS, OBJECTS = OBJECTS, DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) @@ -408,7 +423,8 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): " --stringparam module $MODULE" + " --stringparam type $TYPE" + " ${SOURCES[1]} $SOURCE || touch $TARGET" ], - MODULE = xmlnode.dir.dir.dir.name, + MODULE = xmlnode.dir.dir.dir.abspath[ + len(env.Dir('#').abspath)+1:], TYPE = type) env.SideEffect(xref, xmlnode) env.AddPreAction(docs, "rm -f %s" % (xref,)) @@ -416,7 +432,19 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): xrefs.extend(xref_pp) docs.extend(xrefs) - env.Depends(docs, extra_sources) + if extra_sources and htmlnode: + env.Depends(docs, + [ env.CopyToDir( source=source, target=htmlnode.dir ) + for source in extra_sources ]) + + if extra_sources and xmlnode: + env.Depends(docs, + [ env.CopyToDir( source=source, target=xmlnode.dir ) + for source in extra_sources ]) + + if not htmlnode and not xmlnode: + env.Depends(docs, extra_sources) + for doc in docs : env.Alias('all_docs', doc) env.Clean('all_docs', doc)