2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 00:32:11 +00:00

Fix pch support for Intel on Win32.

[SVN r49458]
This commit is contained in:
John Maddock
2008-10-26 18:43:35 +00:00
parent 452ced6656
commit c4d4e66c71
2 changed files with 41 additions and 2 deletions

View File

@@ -12,7 +12,8 @@ import intel ;
import msvc ;
import os ;
import toolset ;
import generators ;
import type ;
feature.extend-subfeature toolset intel : platform : win ;
@@ -20,6 +21,14 @@ toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win
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 @@ rule init ( version ? : # the compiler version
}
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 ;

View File

@@ -352,6 +352,7 @@ rule compile-c-c++ ( targets + : sources * )
# 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 @@ actions compile-c-c++-pch
# 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 default-paths ( version ? )
}
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)