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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam
index bf07a93..cf04eba 100644
--- a/src/tools/msvc.jam
+++ b/src/tools/msvc.jam
@@ -450,19 +450,19 @@ rule configure-version-specific ( toolset : version : conditions )
# version 7.* explicitly or if we auto-detected the version ourselves.
if ! [ MATCH ^(6\\.) : $(version) ]
{
- toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:forScope" "/Zc:wchar_t" ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions) : "/Zc:forScope" "/Zc:wchar_t" ;
toolset.flags $(toolset).compile.c++ C++FLAGS $(conditions) : /wd4675 ;
# Explicitly disable the 'function is deprecated' warning. Some msvc
# versions have a bug, causing them to emit the deprecation warning even
# with /W0.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>off : /wd4996 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<warnings>off : /wd4996 ;
if [ MATCH "^([78]\\.)" : $(version) ]
{
# 64-bit compatibility warning deprecated since 9.0, see
# http://msdn.microsoft.com/en-us/library/yt4xw8fh.aspx
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>all : /Wp64 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<warnings>all : /Wp64 ;
}
}
@@ -471,17 +471,17 @@ rule configure-version-specific ( toolset : version : conditions )
# variables and functions that have internal linkage
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 12 ]
{
- toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:inline" ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions) : "/Zc:inline" ;
# /Gy analog for variables: https://devblogs.microsoft.com/cppblog/introducing-gw-compiler-switch/
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Gw ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Gw ;
}
# 14.0 introduced /Zc:throwingNew opt-in flag that disables a workaround
# for not throwing operator new in VC up to 6.0
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 ]
{
- toolset.flags $(toolset).compile CFLAGS $(conditions) : "/Zc:throwingNew" ;
+ toolset.flags $(toolset).compile C++FLAGS $(conditions) : "/Zc:throwingNew" ;
}
#
@@ -491,34 +491,34 @@ rule configure-version-specific ( toolset : version : conditions )
if [ MATCH "^([67])" : $(version) ]
{
# 8.0 deprecates some of the options.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Ogiy /Gs ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed : /Ot ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>space : /Os ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Ogiy /Gs ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<optimization>speed : /Ot ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<optimization>space : /Os ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set> : /GB ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i486 : /G4 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g5) : /G5 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g6) : /G6 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g7) : /G7 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/<instruction-set> : /GB ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i486 : /G4 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g5) : /G5 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g6) : /G6 ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g7) : /G7 ;
# Improve floating-point accuracy. Otherwise, some of C++ Boost's "math"
# tests will fail.
- toolset.flags $(toolset).compile CFLAGS $(conditions) : /Op ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions) : /Op ;
# 7.1 and below have single-threaded static RTL.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /ML ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MLd ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /ML ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MLd ;
}
else
{
# 8.0 and above adds some more options.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set> : "/favor:blend" ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-em64t) : "/favor:EM64T" ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-amd64) : "/favor:AMD64" ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/<instruction-set> : "/favor:blend" ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-em64t) : "/favor:EM64T" ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-amd64) : "/favor:AMD64" ;
# 8.0 and above only has multi-threaded static RTL.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /MT ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MTd ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /MT ;
+ toolset.flags $(toolset).compile OPTIONS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MTd ;
# Specify target machine type so the linker will not need to guess.
toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-amd64) : "/MACHINE:X64" ;
@@ -614,7 +614,7 @@ rule compile.c ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
C++FLAGS on $(targets[1]) = ;
- get-rspline $(targets) : -TC ;
+ get-rspline $(targets) : -TC CFLAGS ;
compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
}
@@ -623,7 +623,7 @@ rule compile.c.preprocess ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
C++FLAGS on $(targets[1]) = ;
- get-rspline $(targets) : -TC ;
+ get-rspline $(targets) : -TC CFLAGS ;
preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
}
@@ -632,8 +632,8 @@ rule compile.c.pch ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
C++FLAGS on $(targets[1]) = ;
- get-rspline $(targets[1]) : -TC ;
- get-rspline $(targets[2]) : -TC ;
+ get-rspline $(targets[1]) : -TC CFLAGS ;
+ get-rspline $(targets[2]) : -TC CFLAGS ;
local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
if $(pch-source)
{
@@ -716,14 +716,14 @@ actions compile-c-c++-pch-s
rule compile.c++ ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
- get-rspline $(targets) : -TP ;
+ get-rspline $(targets) : -TP C++FLAGS ;
compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
}
rule compile.c++.preprocess ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
- get-rspline $(targets) : -TP ;
+ get-rspline $(targets) : -TP C++FLAGS ;
preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
}
@@ -731,8 +731,8 @@ rule compile.c++.preprocess ( targets + : sources * : properties * )
rule compile.c++.pch ( targets + : sources * : properties * )
{
set-setup-command $(targets) : $(properties) ;
- get-rspline $(targets[1]) : -TP ;
- get-rspline $(targets[2]) : -TP ;
+ get-rspline $(targets[1]) : -TP C++FLAGS ;
+ get-rspline $(targets[2]) : -TP C++FLAGS ;
local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
if $(pch-source)
{
@@ -1691,10 +1691,10 @@ local rule default-path ( version )
-rule get-rspline ( target : lang-opt )
+rule get-rspline ( target : lang-opt lang-flags )
{
CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS)
- $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(.nl)-D$(DEFINES)
+ $($(lang-flags)) $(OPTIONS) -c $(.nl)-D$(DEFINES)
$(.nl)\"-I$(INCLUDES:W)\" $(.nl)\"-FI$(FORCE_INCLUDES:W)\" ] ;
}
@@ -1830,25 +1830,25 @@ local rule register-toolset-really ( )
# Declare flags for compilation.
#
- toolset.flags msvc.compile CFLAGS <optimization>speed : /O2 ;
- toolset.flags msvc.compile CFLAGS <optimization>space : /O1 ;
+ toolset.flags msvc.compile OPTIONS <optimization>speed : /O2 ;
+ toolset.flags msvc.compile OPTIONS <optimization>space : /O1 ;
- toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium) : /G1 ;
- toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium2) : /G2 ;
+ toolset.flags msvc.compile OPTIONS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium) : /G1 ;
+ toolset.flags msvc.compile OPTIONS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium2) : /G2 ;
- toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>object : /Z7 ;
- toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>database : /Zi ;
- toolset.flags msvc.compile CFLAGS <optimization>off : /Od ;
- toolset.flags msvc.compile CFLAGS <inlining>off : /Ob0 ;
- toolset.flags msvc.compile CFLAGS <inlining>on : /Ob1 ;
- toolset.flags msvc.compile CFLAGS <inlining>full : /Ob2 ;
+ toolset.flags msvc.compile OPTIONS <debug-symbols>on/<debug-store>object : /Z7 ;
+ toolset.flags msvc.compile OPTIONS <debug-symbols>on/<debug-store>database : /Zi ;
+ toolset.flags msvc.compile OPTIONS <optimization>off : /Od ;
+ toolset.flags msvc.compile OPTIONS <inlining>off : /Ob0 ;
+ toolset.flags msvc.compile OPTIONS <inlining>on : /Ob1 ;
+ toolset.flags msvc.compile OPTIONS <inlining>full : /Ob2 ;
- toolset.flags msvc.compile CFLAGS <warnings>on : /W3 ;
- toolset.flags msvc.compile CFLAGS <warnings>off : /W0 ;
- toolset.flags msvc.compile CFLAGS <warnings>all : /W4 ;
- toolset.flags msvc.compile CFLAGS <warnings>extra : /W4 ;
- toolset.flags msvc.compile CFLAGS <warnings>pedantic : /W4 ;
- toolset.flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ;
+ toolset.flags msvc.compile OPTIONS <warnings>on : /W3 ;
+ toolset.flags msvc.compile OPTIONS <warnings>off : /W0 ;
+ toolset.flags msvc.compile OPTIONS <warnings>all : /W4 ;
+ toolset.flags msvc.compile OPTIONS <warnings>extra : /W4 ;
+ toolset.flags msvc.compile OPTIONS <warnings>pedantic : /W4 ;
+ toolset.flags msvc.compile OPTIONS <warnings-as-errors>on : /WX ;
toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ;
toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ;
@@ -1862,16 +1862,16 @@ local rule register-toolset-really ( )
# By default 8.0 enables rtti support while prior versions disabled it. We
# simply enable or disable it explicitly so we do not have to depend on this
# default behaviour.
- toolset.flags msvc.compile CFLAGS <rtti>on : /GR ;
- toolset.flags msvc.compile CFLAGS <rtti>off : /GR- ;
- toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>shared : /MD ;
- toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>shared : /MDd ;
+ toolset.flags msvc.compile C++FLAGS <rtti>on : /GR ;
+ toolset.flags msvc.compile C++FLAGS <rtti>off : /GR- ;
+ toolset.flags msvc.compile OPTIONS <runtime-debugging>off/<runtime-link>shared : /MD ;
+ toolset.flags msvc.compile OPTIONS <runtime-debugging>on/<runtime-link>shared : /MDd ;
- toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ;
- toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ;
+ toolset.flags msvc.compile OPTIONS <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ;
+ toolset.flags msvc.compile OPTIONS <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ;
- toolset.flags msvc.compile OPTIONS <cflags> : ;
- toolset.flags msvc.compile.c++ OPTIONS <cxxflags> : ;
+ toolset.flags msvc.compile CFLAGS <cflags> : ;
+ toolset.flags msvc.compile.c++ C++FLAGS <cxxflags> : ;
toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ;
|