Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81498 - trunk/tools/build/v2/tools
From: steven_at_[hidden]
Date: 2012-11-23 13:56:48


Author: steven_watanabe
Date: 2012-11-23 13:56:47 EST (Fri, 23 Nov 2012)
New Revision: 81498
URL: http://svn.boost.org/trac/boost/changeset/81498

Log:
Fix PDB location. Fixes #7491.
Text files modified:
   trunk/tools/build/v2/tools/msvc.jam | 46 +++++++++++++++++++++++++++++++++++++--
   1 files changed, 43 insertions(+), 3 deletions(-)

Modified: trunk/tools/build/v2/tools/msvc.jam
==============================================================================
--- trunk/tools/build/v2/tools/msvc.jam (original)
+++ trunk/tools/build/v2/tools/msvc.jam 2012-11-23 13:56:47 EST (Fri, 23 Nov 2012)
@@ -385,7 +385,8 @@
 {
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
- PDB_NAME on $(<) = $(<:S=.pdb) ;
+ PDB_NAME on $(<) = $(<[1]:S=.pdb) ;
+ LOCATE on $(<[1]:S=.pdb) = [ on $(<[1]) return $(LOCATE) ] ;
 }
 
 rule preprocess-c-c++ ( targets + : sources * )
@@ -393,6 +394,7 @@
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
     PDB_NAME on $(<) = $(<:S=.pdb) ;
+ LOCATE on $(<[1]:S=.pdb) = [ on $(<[1]) return $(LOCATE) ] ;
 }
 
 # Action for running the C/C++ compiler using precompiled headers. In addition
@@ -559,7 +561,7 @@
 #
 rule archive ( targets + : sources * : properties * )
 {
- PDB_NAME on $(>) = $(<:S=.pdb) ;
+ PDB_NAME on $(>) = $(<[1]:S=.pdb) ;
 }
 
 
@@ -1116,6 +1118,41 @@
 }
 
 
+class msvc-archive-generator : archive-generator
+{
+ rule generated-targets ( sources + : property-set : project name ? )
+ {
+ local result = [ archive-generator.generated-targets $(sources)
+ : $(property-set) : $(project) $(name) ] ;
+
+ if $(result)
+ {
+ local name-main = [ $(result[0]).name ] ;
+ local action = [ $(result[0]).action ] ;
+
+ if [ $(property-set).get <debug-symbols> ] = "on"
+ {
+ # We force the exact name on PDB. The reason is tagging -- the
+ # tag rule may reasonably special case some target types, like
+ # SHARED_LIB. The tag rule will not catch PDBs, and it cannot
+ # even easily figure out if a PDB is paired with a SHARED_LIB,
+ # EXE or something else. Because PDBs always get the same name
+ # as the main target, with .pdb as extension, just force it.
+ local target = [ class.new file-target $(name-main:S=.pdb) exact
+ : PDB : $(project) : $(action) ] ;
+ local registered-target = [ virtual-target.register $(target) ]
+ ;
+ if $(target) != $(registered-target)
+ {
+ $(action).replace-targets $(target) : $(registered-target) ;
+ }
+ result += $(registered-target) ;
+ }
+ }
+ return $(result) ;
+ }
+}
+
 
 # Unsafe worker rule for the register-toolset() rule. Must not be called
 # multiple times.
@@ -1154,7 +1191,10 @@
             OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB :
             <toolset>msvc ] ;
 
- generators.register-archiver msvc.archive : OBJ : STATIC_LIB : <toolset>msvc ;
+ generators.register [ new msvc-archive-generator msvc.archive :
+ OBJ : STATIC_LIB :
+ <toolset>msvc ] ;
+
         generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
         generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ;
         generators.register-c-compiler msvc.compile.c++.preprocess : CPP : PREPROCESSED_CPP : <toolset>msvc ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk