X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=SConstruct;h=b992cd6f55da9a6f09f46a785ce9ddeff90fc314;hb=08bba1cbe020e940671a58c0db5afce75ef84619;hp=0e0f4d7d2e9aa107bfd30548e953bcc7882a9c3b;hpb=10985d71f77b627bc4da543d7114feb7c4529329;p=senf.git diff --git a/SConstruct b/SConstruct index 0e0f4d7..b992cd6 100644 --- a/SConstruct +++ b/SConstruct @@ -173,6 +173,21 @@ env.Append( 'config.hh', 'local_config.hh' ], ) +def parseLogOption(value): + stream, area, level = ( x.strip() for x in value.strip().split('|') ) + if stream : stream = ''.join('(%s)' % x for x in stream.split('::') ) + else : stream = '(_)' + if area : area = ''.join( '(%s)' % x for x in area.split('::') ) + else : area = '(_)' + return '(( %s,%s,%s ))' % (stream,area,level) + +def expandLogOption(target, source, env, for_signature): + return ' '.join( parseLogOption(x) for x in env.subst('$LOGLEVELS').split() ) + +if env.subst('$LOGLEVELS'): + env.Append( expandLogOption=expandLogOption ) + env.Append( CPPDEFINES = { 'SENF_LOG_CONF': '$expandLogOption' } ) + env.SetDefault( LIBSENF = "senf" ) @@ -181,7 +196,7 @@ Export('env') # Create Doxyfile.local otherwise doxygen will barf on this non-existent file # Create it even when cleaning, to silence the doxygen builder warnings -if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"): +if not os.path.exists("Doxyfile.local"): Execute(Touch("Doxyfile.local")) # Create local_config.h