[Bf-committers] SCons - build MSVC "Object Browser" database

Jonathan Harris bf-committers@blender.org
Tue, 16 Mar 2004 20:33:20 +0000


This is a multi-part message in MIME format.
--------------020600020106060202070901
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This makes SCons build the MSVC7 "Object Browser" database when building
a debug binary. I've only tested with MSVC7, but it should also work
with MSVC6 (this functionality is called "Source Browser" in MSVC6).

MSVC will open the database automatically when you debug blender.exe.
The database needs to be explicitly closed before rebuilding by removing
it from the MSVC7 "Solution Explorer" window. Add it back after the build.

TODO: .sbr intermediate files are created in the build tree. These
should be removed by a clean but aren't.

Jonathan.

--------------020600020106060202070901
Content-Type: text/plain;
 name="sbr.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sbr.diff"

Index: SConstruct
===================================================================
RCS file: /cvsroot/bf-blender/blender/SConstruct,v
retrieving revision 1.30
diff -u -r1.30 SConstruct
--- SConstruct	15 Mar 2004 19:55:11 -0000	1.30
+++ SConstruct	16 Mar 2004 20:30:22 -0000
@@ -256,7 +256,7 @@
     build_blender_player = 'false'
     build_blender_plugin = 'false'
     release_flags = ['/G6', '/GF']
-    debug_flags = ['/Zi']
+    debug_flags = ['/Zi', '/Fr${TARGET.base}.sbr']
     extra_flags = ['/EHsc', '/J', '/W3', '/Gd', '/MT']
     cxxflags = []
     defines = ['WIN32', '_CONSOLE']
@@ -1022,3 +1022,12 @@
                     'chmod +x $TARGET && ' + \
                     'find $SOURCE -name CVS -prune -exec rm -rf {} \; && ' +
                     'find $SOURCE -name .DS_Store -exec rm -rf {} \;')
+
+if sys.platform == 'win32' and user_options_dict['BUILD_BINARY'] == 'debug':
+    browser = Environment ()
+    browser_tmp=root_build_dir+'bscmake.tmp'
+    browser.Command ('blender.bsc', 'blender$PROGSUFFIX',
+                     ['dir /b/s '+root_build_dir+'*.sbr >'+browser_tmp,
+                      'bscmake /nologo /n /oblender.bsc @'+browser_tmp,
+                      'del '+browser_tmp])
+

--------------020600020106060202070901--