==SCons==
authorNathan Letwory <nathan@letworyinteractive.com>
Thu, 19 Oct 2006 12:35:39 +0000 (12:35 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Thu, 19 Oct 2006 12:35:39 +0000 (12:35 +0000)
* Source Browser support. When BF_DEBUG=1 .bsc-files will be created in BF_BUILDDIR. .pdb-files are in the root source dir

config/win32-vc-config.py
tools/Blender.py

index cbed1ccbc5ee6c7ba7fff5db8bd0d1d1d4345897..eb0a2ca2939fee830d89dc470a68dc7f9b4690f7 100644 (file)
@@ -135,6 +135,8 @@ CXX = 'cl.exe'
 
 CCFLAGS = ['/nologo', '/Og', '/Ot', '/Ob1', '/Op', '/G6','/EHsc', '/J', '/W3', '/Gd', '/MT']
 
+BF_DEBUG_FLAGS = ['/Zi', '/FR${TARGET.base}.sbr']
+
 CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DUSE_OPENAL', '-DFTGL_LIBRARY_STATIC']
 REL_CFLAGS = ['-O2', '-DNDEBUG']
 REL_CCFLAGS = ['-O2', '-DNDEBUG']
index 4f7fd2ebcdcfdb0ca406ccce08e9ef3ab4d17305..4e8ac0f5bf210a57e56d651d7872788823805658 100644 (file)
@@ -291,8 +291,8 @@ def AppIt(target=None, source=None, env=None):
     binary = env['BINARYKIND']
      
     if b=='verse':
-       print bc.OKBLUE+"no bundle for verse"+bc.ENDC 
-       return 0
+        print bc.OKBLUE+"no bundle for verse"+bc.ENDC 
+        return 0
    
     
     sourcedir = bldroot + '/source/darwin/%s.app'%binary
@@ -330,6 +330,27 @@ def AppIt(target=None, source=None, env=None):
 
 #### END ACTION STUFF #########
 
+def bsc(env, target, source):
+    
+    bd = os.path.dirname(target[0].abspath)
+    bscfile = '\"'+target[0].abspath+'\"'
+    bscpathcollect = '\"'+bd + os.sep + '*.sbr\"'
+    bscpathtmp = '\"'+bd + os.sep + 'bscmake.tmp\"'
+
+    os.system('dir /b/s '+bscpathcollect+' >'+bscpathtmp)
+
+    myfile = open(bscpathtmp[1:-1], 'r')
+    lines = myfile.readlines()
+    myfile.close()
+
+    newfile = open(bscpathtmp[1:-1], 'w')
+    for l in lines:
+        newfile.write('\"'+l[:-1]+'\"\n')
+    newfile.close()
+                
+    os.system('bscmake /nologo /n /o'+bscfile+' @'+bscpathtmp)
+    os.system('del '+bscpathtmp)
+
 class BlenderEnvironment(SConsEnvironment):
 
     def BlenderRes(self=None, libname=None, source=None, libtype=['core'], priority=[100]):
@@ -339,7 +360,7 @@ class BlenderEnvironment(SConsEnvironment):
             Exit()
         if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross'):
             print bc.FAIL+'BlenderRes is for windows only!'+bc.END
-            Exit()
+            self.Exit()
         
         print bc.HEADER+'Configuring resource '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC
         lenv = self.Copy()
@@ -385,6 +406,8 @@ class BlenderEnvironment(SConsEnvironment):
         lenv = self.Copy()
         if lenv['OURPLATFORM'] in ['win32-vc', 'cygwin']:
             lenv.Append(LINKFLAGS = Split(lenv['PLATFORM_LINKFLAGS']))
+            if lenv['BF_DEBUG']:
+                lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
         if  lenv['OURPLATFORM']=='linux2':
             lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
             lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
@@ -404,6 +427,10 @@ class BlenderEnvironment(SConsEnvironment):
              lenv.Append(LIBS = lenv['BF_QUICKTIME_LIB'])
              lenv.Append(LIBPATH = lenv['BF_QUICKTIME_LIBPATH'])
         prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
+        if lenv['BF_DEBUG'] and lenv['OURPLATFORM']=='win32-vc':
+            f = lenv.File(progname + '.bsc', builddir)
+            brs = lenv.Command(f, prog, [bsc])
+            SConsEnvironment.Default(self, brs)
         SConsEnvironment.Default(self, prog)
         program_list.append(prog)
         if  lenv['OURPLATFORM']=='darwin':