Index: intel-win.jam =================================================================== --- intel-win.jam (revision 49070) +++ intel-win.jam (working copy) @@ -12,14 +12,23 @@ import msvc ; import os ; import toolset ; +import generators ; +import type ; - feature.extend-subfeature toolset intel : platform : win ; toolset.inherit-generators intel-win intel win : msvc ; 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 on : ; + +type.set-generated-target-suffix PCH : intel win : pchi ; + toolset.add-requirements intel-win,shared:multi ; # Initializes the intel toolset for windows @@ -159,3 +168,29 @@ } toolset.flags intel-win.link LIBRARY_OPTION 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 explicitly pass +# the extension pch here, so that extension produced by compiler, and extension +# Boost.Build expects, are actually indentical. +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) +} + +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) +} + +# 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 ; Index: msvc.jam =================================================================== --- msvc.jam (revision 49070) +++ msvc.jam (working copy) @@ -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)