==SCons==

* Applied patch #4012 by Joseph Eagar. The patch provides a way to quickly assign a list
  of libraries to build with debug symbols. Usage:

  scons BF_QUICKDEBUG=src,bf_blenkernel,bf_blenlib
This commit is contained in:
Nathan Letwory
2006-03-17 16:38:39 +00:00
parent 73da80e757
commit b92c2197ec
4 changed files with 28 additions and 4 deletions

View File

@@ -51,6 +51,7 @@ B = tools.Blender
### globals ###
platform = sys.platform
quickie = None
quickdebug = None
##### BEGIN SETUP #####
@@ -88,6 +89,13 @@ btools.print_targets(B.targets, B.bc)
# first check cmdline for toolset and we create env to work on
quickie = B.arguments.get('BF_QUICK', None)
quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
if quickdebug:
B.quickdebug=string.split(quickdebug, ',')
else:
B.quickdebug=[]
if quickie:
B.quickie=string.split(quickie,',')
else:
@@ -151,6 +159,18 @@ else:
opts = btools.read_opts(optfiles, B.arguments)
opts.Update(env)
#check for additional debug libnames
if env.has_key('BF_DEBUG_LIBS'):
B.quickdebug += env['BF_DEBUG_LIBS']
printdebug = B.arguments.get('BF_LISTDEBUG', 0)
if len(B.quickdebug) > 0 and printdebug != 0:
print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
for l in B.quickdebug:
print "\t" + l
# check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
if 'blenderplayer' in B.targets:
env['WITH_BF_PLAYER'] = True

View File

@@ -146,7 +146,7 @@ LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lw
##DYNLDFLAGS = -shared $(LDFLAGS)
BF_DEBUG = 'false'
BF_DEBUG_FLAGS= ''
BF_DEBUG_FLAGS= '-g'
BF_BUILDDIR = '..\\build\\win32-mingw'
BF_INSTALLDIR='..\\install\\win32-mingw'

View File

@@ -343,13 +343,16 @@ class BlenderEnvironment(SConsEnvironment):
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
Exit()
if libname in quickie or len(quickie)==0:
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC
if libname in quickdebug:
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname +bc.ENDC+bc.OKBLUE+ " (debug mode)" + bc.ENDC
else:
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname + bc.ENDC
lenv = self.Copy()
lenv.Append(CPPPATH=includes)
lenv.Append(CPPDEFINES=defines)
if lenv['WITH_BF_GAMEENGINE']:
lenv.Append(CPPDEFINES=['GAMEBLENDER=1'])
if lenv['BF_DEBUG']:
if lenv['BF_DEBUG'] or (libname in quickdebug):
lenv.Append(CCFLAGS = Split(lenv['BF_DEBUG_FLAGS']), CXXFLAGS = Split(lenv['BF_DEBUG_FLAGS']))
else:
lenv.Append(CCFLAGS = lenv['REL_CFLAGS'], CXXFLAGS = lenv['REL_CCFLAGS'])

View File

@@ -45,7 +45,7 @@ def validate_arguments(args, bc):
arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_DEBUG', 'BF_DEBUG_FLAGS',
'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX'
'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', "BF_QUICKDEBUG", "BF_LISTDEBUG"
]
all_list = opts_list + arg_list
@@ -110,6 +110,7 @@ def SetupBufferedOutput( env ):
def read_opts(cfg, args):
localopts = Options.Options(cfg, args)
localopts.AddOptions(
('BF_DEBUG_LIBS', 'list of libraries to build with debug symbols'),
('BF_PYTHON', 'base path for python', ''),
('BF_PYTHON_VERSION', 'Python version to use', ''),
('BF_PYTHON_INC', 'include path for Python headers', ''),