1 # Copyright Vladimir Prus 2004.
2 # Distributed under the Boost Software License, Version 1.0.
3 # (See accompanying file LICENSE_1_0.txt
4 # or copy at http://www.boost.org/LICENSE_1_0.txt)
6 # Importing common is needed because the rules we inherit here depend on it.
18 feature.extend-subfeature toolset intel : platform : win ;
20 toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
21 toolset.inherit-flags intel-win : msvc : : YLOPTION ;
22 toolset.inherit-rules intel-win : msvc ;
24 # Override default do-nothing generators.
25 generators.override intel-win.compile.c.pch : pch.default-c-pch-generator ;
26 generators.override intel-win.compile.c++.pch : pch.default-cpp-pch-generator ;
27 generators.override intel-win.compile.rc : rc.compile.resource ;
28 generators.override intel-win.compile.mc : mc.compile ;
30 toolset.flags intel-win.compile PCH_SOURCE <pch>on : <pch-source> ;
32 toolset.add-requirements <toolset>intel-win,<runtime-link>shared:<threading>multi ;
34 # Initializes the intel toolset for windows
35 rule init ( version ? : # the compiler version
36 command * : # the command to invoke the compiler itself
37 options * # Additional option: <compatibility>
38 # either 'vc6', 'vc7', 'vc7.1'
39 # or 'native'(default).
43 [ feature.get-values <compatibility> : $(options) ] ;
44 local condition = [ common.check-init-parameters intel-win
45 : version $(version) : compatibility $(compatibility) ] ;
47 command = [ common.get-invocation-command intel-win : icl.exe :
50 common.handle-options intel-win : $(condition) : $(command) : $(options) ;
55 root = [ common.get-absolute-tool-path $(command[-1]) ] ;
60 setup = [ GLOB $(root) : iclvars_*.bat ] ;
63 setup = $(root)/iclvars.bat ;
65 setup = "call \""$(setup)"\" > nul " ;
74 setup = "cmd /S /C "$(setup)" \"&&\" " ;
77 toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ;
78 toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ;
79 toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
80 toolset.flags intel-win.link .MT $(condition) : $(setup)mt -nologo ;
81 toolset.flags intel-win.compile .MC $(condition) : $(setup)mc ;
82 toolset.flags intel-win.compile .RC $(condition) : $(setup)rc ;
84 local m = [ MATCH (.).* : $(version) ] ;
85 local major = $(m[1]) ;
91 # Reduce the number of spurious error messages
92 C++FLAGS += /Qwn5 /Qwd985 ;
95 C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too
97 # Disable Microsoft "secure" overloads in Dinkumware libraries since they
98 # cause compile errors with Intel versions 9 and 10.
99 C++FLAGS += -D_SECURE_SCL=0 ;
103 C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping.
106 # Add options recognized only by intel7 and above.
109 C++FLAGS += /Qansi_alias ;
112 if $(compatibility) = vc6
118 # No wchar_t support in vc6 dinkum library. Furthermore, in vc6
119 # compatibility-mode, wchar_t is not a distinct type from unsigned
121 -DBOOST_NO_INTRINSIC_WCHAR_T
128 # Add support for wchar_t
129 C++FLAGS += /Zc:wchar_t
130 # Tell the dinkumware library about it.
131 -D_NATIVE_WCHAR_T_DEFINED
136 if $(compatibility) && $(compatibility) != native
138 C++FLAGS += /Q$(base-vc) ;
143 -Qoption,cpp,--arg_dep_lookup
144 # The following options were intended to disable the Intel compiler's
145 # 'bug-emulation' mode, but were later reported to be causing ICE with
146 # Intel-Win 9.0. It is not yet clear which options can be safely used.
147 # -Qoption,cpp,--const_string_literals
148 # -Qoption,cpp,--new_for_init
149 # -Qoption,cpp,--no_implicit_typename
150 # -Qoption,cpp,--no_friend_injection
151 # -Qoption,cpp,--no_microsoft_bugs
155 toolset.flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
156 # By default, when creating PCH, intel adds 'i' to the explicitly
157 # specified name of the PCH file. Of course, Boost.Build is not
158 # happy when compiler produces not the file it was asked for.
159 # The option below stops this behaviour.
160 toolset.flags intel-win CFLAGS : -Qpchi- ;
162 if ! $(compatibility)
164 # If there's no backend version, assume 10.
165 compatibility = vc10 ;
168 local extract-version = [ MATCH ^vc(.*) : $(compatibility) ] ;
169 if ! $(extract-version)
171 errors.user-error "Invalid value for compatibility option:"
175 # Depending on the settings, running of tests require some runtime DLLs.
176 toolset.flags intel-win RUN_PATH $(condition) : $(root) ;
178 msvc.configure-version-specific intel-win : $(extract-version[1]) : $(condition) ;
181 toolset.flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
183 toolset.flags intel-win YLOPTION ;