X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FSENFSCons.py;h=94b1b1cf50f469bd0a8c7c0ca99d5fb91436b721;hb=10985d71f77b627bc4da543d7114feb7c4529329;hp=d31c844aaad47d6558cb77c7c0c2e7574938b8cc;hpb=8ec0b7ed2df36144b52df5aa40497fc5409c31f7;p=senf.git diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index d31c844..94b1b1c 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -52,6 +52,7 @@ SCONS_TOOLS = [ "CopyToDir", "InstallIncludes", "ProgramNoScan", + "CompileCheck", ] opts = None @@ -242,8 +243,7 @@ def MakeEnvironment(): # These are the default compilation parameters. We should probably # make these configurable - env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ], - LOCALLIBDIR = [ '#' ], + env.Append(LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: @@ -251,7 +251,7 @@ def MakeEnvironment(): else: # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails: # CPPDEFINES = [ '_GLIBCXX_DEBUG' ], - env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], + env.Append(CXXFLAGS = [ '-O0', '-g' ], CPPDEFINES = [ 'SENF_DEBUG' ], LINKFLAGS = [ '-g', '-rdynamic' ]) @@ -304,13 +304,17 @@ def GlobalTargets(env): def LibPath(lib): return '${LOCALLIBDIR}/${LIBPREFIX}%s${LIBADDSUFFIX}${LIBSUFFIX}' % lib def Test(env, sources, LIBS = [], OBJECTS = []): - test = env.BoostUnitTests( + test = [ env.BoostUnitTests( target = 'test', objects = [], test_sources = sources, LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ], OBJECTS = OBJECTS, - DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) + DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) ] + compileTestSources = [ src for src in sources + if 'COMPILE_CHECK' in file(src).read() ] + if compileTestSources: + test.extend(env.CompileCheck(source = compileTestSources)) env.Alias('all_tests', test) env.Alias(env.File('test'), test) @@ -351,13 +355,17 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = [], no_includ objects += env.Object(obsources) if testSources: - test = env.BoostUnitTests( + test = [ env.BoostUnitTests( target = 'test', objects = objects, test_sources = testSources, LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ], OBJECTS = OBJECTS, - DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) + DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) ] + compileTestSources = [ src for src in testSources + if 'COMPILE_CHECK' in file(src).read() ] + if compileTestSources: + test.extend(env.CompileCheck(source = compileTestSources)) env.Alias('all_tests', test) # Hmm ... here I'd like to use an Alias instead of a file # however the alias does not seem to live in the subdirectory