1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
# Copyright Vladimir Prus 2004.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
import toolset ;
import feature ;
import toolset : flags ;
import os ;
# This is needed because the rule we import here depend on 'common'
# That's nasty.
import common ;
import intel ;
feature.extend-subfeature toolset intel : platform : win ;
import msvc ;
toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
toolset.inherit-flags intel-win : msvc ;
toolset.inherit-rules intel-win : msvc ;
# Initializes the intel toolset for windows
rule init ( version ? : # the compiler version
command * : # the command to invoke the compiler itself
options * # Additional option: <compatibility>
# either 'vc6', 'vc7', 'vc7.1'
# or 'native'(default).
)
{
local compatibility =
[ feature.get-values <compatibility> : $(options) ] ;
local condition = [ common.check-init-parameters intel-win
: version $(version) : compatibility $(compatibility) ] ;
command = [ common.get-invocation-command intel-win : icc.exe :
$(command) ] ;
common.handle-options intel-win : $(condition) : $(command) : $(options) ;
local root ;
if $(command)
{
root = [ common.get-absolute-tool-path $(command[-1]) ] ;
root = $(root)/ ;
}
local setup ;
setup = $(root)/iclvars.bat ;
setup = "call \""$(setup)"\" > nul " ;
if [ os.name ] = NT
{
setup = $(setup)"
" ;
}
else
{
setup = "cmd /S /C "$(setup)" \"&&\" " ;
}
flags intel-win.compile .CC $(condition) : $(setup)icl ;
flags intel-win.link .LD $(condition) : $(setup)xilink ;
flags intel-win.archive .LD $(condition) : $(setup)xilink ;
local m = [ MATCH (.).* : $(version) ] ;
local major = $(m[1]) ;
local C++FLAGS ;
# Reduce the number of spurious error messages
C++FLAGS += /Qwn5 /Qwd985 ;
# Enable ADL
C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too
if $(major) > 5
{
C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping
}
# Add options recognized only by intel7
if $(major) >= 7
{
C++FLAGS += /Qansi_alias ;
}
if $(compatibility) = vc6
{
C++FLAGS +=
# Emulate VC6
/Qvc6
# no wchar_t support in vc6 dinkum library. Furthermore, in vc6
# compatibility-mode, wchar_t is not a distinct type from unsigned
# short
-DBOOST_NO_INTRINSIC_WCHAR_T
;
}
else
{
if $(major) > 5
{
# Add support for wchar_t
C++FLAGS += /Zc:wchar_t
# Tell the dinkumware library about it.
-D_NATIVE_WCHAR_T_DEFINED
;
}
}
if $(compatibility) && $(compatibility) != native
{
C++FLAGS += /Q$(base-vc) ;
}
else
{
C++FLAGS +=
-Qoption,cpp,--arg_dep_lookup
# The following options were intended to disable
# 'bug-emulation' mode of intel compiler, but later
# were reported to case ICE with Intel-Win 9.0
# It's not yet clear which options can be safely used.
# -Qoption,cpp,--const_string_literals
# -Qoption,cpp,--new_for_init
# -Qoption,cpp,--no_implicit_typename
# -Qoption,cpp,--no_friend_injection
# -Qoption,cpp,--no_microsoft_bugs
;
}
flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
}
flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
|