$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r55197 - in branches/release/tools/build/v2: . test tools
From: ghost_at_[hidden]
Date: 2009-07-30 14:43:07
Author: vladimir_prus
Date: 2009-07-27 03:04:57 EDT (Mon, 27 Jul 2009)
New Revision: 55197
URL: http://svn.boost.org/trac/boost/changeset/55197
Log:
Merge from trunk
Properties modified: 
   branches/release/tools/build/v2/   (props changed)
Text files modified: 
   branches/release/tools/build/v2/test/BoostBuild.py |     6 ++--                                    
   branches/release/tools/build/v2/tools/msvc.jam     |    47 ++++++++++++++++++++++++++++++++++++--- 
   2 files changed, 46 insertions(+), 7 deletions(-)
Modified: branches/release/tools/build/v2/test/BoostBuild.py
==============================================================================
--- branches/release/tools/build/v2/test/BoostBuild.py	(original)
+++ branches/release/tools/build/v2/test/BoostBuild.py	2009-07-27 03:04:57 EDT (Mon, 27 Jul 2009)
@@ -572,7 +572,7 @@
             try:
                 glob_remove(self.unexpected_difference.added_files, name)
             except:
-                print "File %s not added as expected" % name
+                annotation("failure", "File %s not added as expected" % name)
                 self.fail_test(1)
 
     def ignore_addition(self, wildcard):
@@ -583,7 +583,7 @@
             try:
                 glob_remove(self.unexpected_difference.removed_files, name)
             except:
-                print "File %s not removed as expected" % name
+                annotation("failure", "File %s not removed as expected" % name)
                 self.fail_test(1)
 
     def ignore_removal(self, wildcard):
@@ -594,7 +594,7 @@
             try:
                 glob_remove(self.unexpected_difference.modified_files, name)
             except:
-                print "File %s not modified as expected" % name
+                annotation("failure", "File %s not modified as expected" % name)
                 self.fail_test(1)
 
     def ignore_modification(self, wildcard):
Modified: branches/release/tools/build/v2/tools/msvc.jam
==============================================================================
--- branches/release/tools/build/v2/tools/msvc.jam	(original)
+++ branches/release/tools/build/v2/tools/msvc.jam	2009-07-27 03:04:57 EDT (Mon, 27 Jul 2009)
@@ -40,6 +40,8 @@
 type.register MANIFEST : manifest ;
 feature.feature embed-manifest : on off : incidental propagated ;
 
+type.register PDB : pdb ;
+
 ################################################################################
 #
 # Public rules.
@@ -259,6 +261,10 @@
         toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-amd64) : /MACHINE:X64 ;
         toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-i386)  : /MACHINE:X86 ;
         toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-ia64)  : /MACHINE:IA64 ;
+        
+        # Make sure that manifest will be generated even if there is no
+        # dependencies to put there.
+        toolset.flags $(toolset).link LINKFLAGS $(conditions)/<embed-manifest>off : /MANIFEST ;
     }
     toolset.pop-checking-for-flags-module ;
 }
@@ -341,15 +347,27 @@
 # Action for running the C/C++ compiler without using precompiled headers.
 #
 # WARNING: Synchronize any changes this in action with intel-win
-actions compile-c-c++
+#
+# Notes regarding PDB generation, for when we use <debug-symbols>on/<debug-store>database
+#
+# 1. PDB_CFLAG is only set for <debug-symbols>on/<debug-store>database, ensuring that the /Fd flag is dropped if PDB_CFLAG is empty
+#
+# 2. When compiling executables's source files, PDB_NAME is set on a per-source file basis by rule compile-c-c++. 
+#    The linker will pull these into the executable's PDB
+#
+# 3. When compiling library's source files, PDB_NAME is updated to <libname>.pdb for each source file by rule archive, 
+#    as in this case the compiler must be used to create a single PDB for our library.
+#
+actions compile-c-c++ bind PDB_NAME
 {
-    $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
+    $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
 }
 
 rule compile-c-c++ ( targets + : sources * )
 {
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
+    PDB_NAME on $(<) = $(<:S=.pdb) ;
 }
 
 # Action for running the C/C++ compiler using precompiled headers. In addition
@@ -501,6 +519,16 @@
     }    
 }
 
+# this rule sets up the pdb file that will be used when generating static 
+# libraries and the debug-store option is database, so that the compiler 
+# puts all debug info into a single .pdb file named after the library
+#
+# Poking at source targets this way is probably not clean, but it's the
+# easiest approach.
+rule archive ( targets + : sources * : properties * )
+{
+    PDB_NAME on $(>) = $(<:S=.pdb) ;
+}
 
 ################################################################################
 #
@@ -1005,12 +1033,23 @@
         {
             local name = [ $(result[0]).name ] ;
             local action = [ $(result[0]).action ] ;
+            
+            if [ $(property-set).get <debug-symbols> ] = "on"
+            {
+                local target = [ class.new file-target $(name) : PDB : $(project) : $(action) ] ;
+                local registered-target = [ virtual-target.register $(target) ] ;
+                if $(target) != $(registered-target)
+                {
+                    $(action).replace-targets $(target) : $(registered-target) ;
+                }
+                result += $(registered-target) ;
+            }
 
             if [ $(property-set).get <embed-manifest> ] = "off"
             {
                 local target = [ class.new file-target $(name) : MANIFEST : $(project) : $(action) ] ;
                 local registered-target = [ virtual-target.register $(target) ] ;
-                if $(action) && ( $(target) != $(registered-target) )
+                if $(target) != $(registered-target)
                 {
                     $(action).replace-targets $(target) : $(registered-target) ;
                 }
@@ -1129,7 +1168,7 @@
     toolset.flags msvc.compile.c OPTIONS <cflags> : ;
     toolset.flags msvc.compile.c++ OPTIONS <cxxflags> : ;
 
-    toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ;  # not used yet
+    toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ;
 
     toolset.flags msvc.compile DEFINES <define> ;
     toolset.flags msvc.compile UNDEFS <undef> ;