Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49699 - in trunk/tools/build/v2: build tools
From: ghost_at_[hidden]
Date: 2008-11-12 09:16:35


Author: vladimir_prus
Date: 2008-11-12 09:16:35 EST (Wed, 12 Nov 2008)
New Revision: 49699
URL: http://svn.boost.org/trac/boost/changeset/49699

Log:
Simplify PCH handling on intel-win, by using -Qpchi- to stop it
to messing up with specified output PCH names.

Text files modified:
   trunk/tools/build/v2/build/toolset.jam | 11 +++++----
   trunk/tools/build/v2/tools/intel-win.jam | 44 ++++++---------------------------------
   trunk/tools/build/v2/tools/msvc.jam | 10 ++------
   3 files changed, 16 insertions(+), 49 deletions(-)

Modified: trunk/tools/build/v2/build/toolset.jam
==============================================================================
--- trunk/tools/build/v2/build/toolset.jam (original)
+++ trunk/tools/build/v2/build/toolset.jam 2008-11-12 09:16:35 EST (Wed, 12 Nov 2008)
@@ -417,15 +417,16 @@
 # When such flag settings must be inherited, define a rule in base toolset
 # module and call it as needed.
 #
-rule inherit-flags ( toolset : base : prohibited-properties * )
+rule inherit-flags ( toolset : base : prohibited-properties * : prohibited-vars * )
 {
     for local f in $(.module-flags.$(base))
     {
         local rule-or-module = $(.rule-or-module.$(f)) ;
- if [ set.difference
- $(.$(rule-or-module).condition.$(f)) :
- $(prohibited-properties)
- ] || ! $(.$(rule-or-module).condition.$(f))
+ if ( [ set.difference
+ $(.$(rule-or-module).condition.$(f)) :
+ $(prohibited-properties) ]
+ || ! $(.$(rule-or-module).condition.$(f))
+ ) && ( ! $(.$(rule-or-module).variable.$(f)) in $(prohibited-vars) )
         {
             local rule_ = [ MATCH "[^.]*\.(.*)" : $(rule-or-module) ] ;
             local new-rule-or-module ;

Modified: trunk/tools/build/v2/tools/intel-win.jam
==============================================================================
--- trunk/tools/build/v2/tools/intel-win.jam (original)
+++ trunk/tools/build/v2/tools/intel-win.jam 2008-11-12 09:16:35 EST (Wed, 12 Nov 2008)
@@ -18,7 +18,7 @@
 feature.extend-subfeature toolset intel : platform : win ;
 
 toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
-toolset.inherit-flags intel-win : msvc ;
+toolset.inherit-flags intel-win : msvc : : YLOPTION ;
 toolset.inherit-rules intel-win : msvc ;
 
 # Override default do-nothing generators.
@@ -27,8 +27,6 @@
 
 toolset.flags intel-win.compile PCH_SOURCE <pch>on : <pch-source> ;
 
-type.set-generated-target-suffix PCH : <toolset>intel <toolset-intel:platform>win : pchi ;
-
 toolset.add-requirements <toolset>intel-win,<runtime-link>shared:<threading>multi ;
 
 # Initializes the intel toolset for windows
@@ -147,6 +145,11 @@
     }
 
     toolset.flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
+ # By default, when creating PCH, intel adds 'i' to the explicitly
+ # specified name of the PCH file. Of course, Boost.Build is not
+ # happy when compiler produces not the file it was asked for.
+ # The option below stops this behaviour.
+ toolset.flags intel-win CFLAGS : -Qpchi- ;
 
     if ! $(compatibility)
     {
@@ -169,37 +172,4 @@
 
 toolset.flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
 
-.escaped-double-quote = "\"" ;
-# Unline msvc, intel-win does not support the -Yl option, so this is a version
-# of msvc rules without -Yl
-# Also note that intel compiler has totally broken handling of the -Fp option --
-# it always adds 'i' to the provided extension. So, we have to copy the actual
-# file produced to the one that Boost.Build expects so that dependency analysis
-# works.
-actions compile-c-c++-pch
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Fp"$(<[1]:S=.pch:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER)
-}
-
-actions compile-c-c++-pch-s
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Fp"$(<[1]:S=.pch:W)" $(CC_RSPLINE))" $(.CC.FILTER)
-}
-
-# We also need to mess with pch vs. pchi here.
-actions compile-c-c++
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:S=.pch:W)" $(CC_RSPLINE))" $(.CC.FILTER)
-}
-
-
-# The compile.c.pch rule that is actually called from the generator for PCH
-# is imported by toolset.inherit-rules, but it's not localized, so it will
-# use compile-c-c++-pch* defined in msvc. Re-import it localized.
-IMPORT msvc : compile.c.pch : intel-win : intel-win.compile.c.pch : localized ;
-IMPORT msvc : compile.c++.pch : intel-win : intel-win.compile.c++.pch : localized ;
-IMPORT msvc : compile.c : intel-win : intel-win.compile.c : localized ;
-IMPORT msvc : compile.c++ : intel-win : intel-win.compile.c++ : localized ;
-# This one is used by compile.c++.pch. Of course, this is a mess, but Python port
-# will clean this up.
-IMPORT msvc : get-rspline : intel-win : get-rspline ;
+toolset.flags intel-win YLOPTION ;

Modified: trunk/tools/build/v2/tools/msvc.jam
==============================================================================
--- trunk/tools/build/v2/tools/msvc.jam (original)
+++ trunk/tools/build/v2/tools/msvc.jam 2008-11-12 09:16:35 EST (Wed, 12 Nov 2008)
@@ -332,6 +332,7 @@
     }
 }
 
+toolset.flags msvc YLOPTION : "-Yl" ;
 
 # Action for running the C/C++ compiler without using precompiled headers.
 #
@@ -347,29 +348,24 @@
     DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
 }
 
-
 # Action for running the C/C++ compiler using precompiled headers. In addition
 # to whatever else it needs to compile, this action also adds a temporary source
 # .cpp file used to compile the precompiled headers themselves.
 #
 # The global .escaped-double-quote variable is used to avoid messing up Emacs
 # syntax highlighting in the messy N-quoted code below.
-#
-# If you change this rule, make corresponding change in intel-win.jam
 actions compile-c-c++-pch
 {
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER)
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER)
 }
 
 
 # Action for running the C/C++ compiler using precompiled headers. An already
 # built source file for compiling the precompiled headers is expected to be
 # given as one of the source parameters.
-#
-# If you change this rule, make corresponding change in intel-win.jam
 actions compile-c-c++-pch-s
 {
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
 }
 
 


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