Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49458 - trunk/tools/build/v2/tools
From: john_at_[hidden]
Date: 2008-10-26 14:43:36


Author: johnmaddock
Date: 2008-10-26 14:43:35 EDT (Sun, 26 Oct 2008)
New Revision: 49458
URL: http://svn.boost.org/trac/boost/changeset/49458

Log:
Fix pch support for Intel on Win32.
Text files modified:
   trunk/tools/build/v2/tools/intel-win.jam | 39 ++++++++++++++++++++++++++++++++++++++-
   trunk/tools/build/v2/tools/msvc.jam | 4 +++-
   2 files changed, 41 insertions(+), 2 deletions(-)

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-10-26 14:43:35 EDT (Sun, 26 Oct 2008)
@@ -12,7 +12,8 @@
 import msvc ;
 import os ;
 import toolset ;
-
+import generators ;
+import type ;
 
 feature.extend-subfeature toolset intel : platform : win ;
 
@@ -20,6 +21,14 @@
 toolset.inherit-flags intel-win : msvc ;
 toolset.inherit-rules intel-win : msvc ;
 
+# Override default do-nothing generators.
+generators.override intel-win.compile.c.pch : pch.default-c-pch-generator ;
+generators.override intel-win.compile.c++.pch : pch.default-cpp-pch-generator ;
+
+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
@@ -159,3 +168,31 @@
 }
 
 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]:W:S=pch)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER)
+ copy "$(<[1]:W:S=pch)i" "$(<[1]:W:S=pch)"
+}
+
+actions compile-c-c++-pch-s
+{
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Fp"$(<[1]:W:S=pch)" $(CC_RSPLINE))" $(.CC.FILTER)
+ copy "$(<[1]:W:S=pch)i" "$(<[1]:W:S=pch)"
+}
+
+# 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 ;
+# 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 ;

Modified: trunk/tools/build/v2/tools/msvc.jam
==============================================================================
--- trunk/tools/build/v2/tools/msvc.jam (original)
+++ trunk/tools/build/v2/tools/msvc.jam 2008-10-26 14:43:35 EDT (Sun, 26 Oct 2008)
@@ -352,6 +352,7 @@
 # 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)
@@ -362,6 +363,7 @@
 # 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)
@@ -943,7 +945,7 @@
 }
 
 
-local rule get-rspline ( target : lang-opt )
+rule get-rspline ( target : lang-opt )
 {
     CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS)
         $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(.nl)-D$(DEFINES)


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