(toolset_arg, version, conditions)
| 147 | return [ cond + '/' + ext for cond in conditions for ext in exts ] |
| 148 | |
| 149 | def configure_version_specific(toolset_arg, version, conditions): |
| 150 | # Starting with versions 7.0, the msvc compiler have the /Zc:forScope and |
| 151 | # /Zc:wchar_t options that improve C++ standard conformance, but those |
| 152 | # options are off by default. If we are sure that the msvc version is at |
| 153 | # 7.*, add those options explicitly. We can be sure either if user specified |
| 154 | # version 7.* explicitly or if we auto-detected the version ourselves. |
| 155 | if not re.match('^6\\.', version): |
| 156 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS',conditions, ['/Zc:forScope','/Zc:wchar_t']) |
| 157 | toolset.flags('{}.compile.c++'.format(toolset_arg), 'C++FLAGS',conditions, ['/wd4675']) |
| 158 | |
| 159 | # Explicitly disable the 'function is deprecated' warning. Some msvc |
| 160 | # versions have a bug, causing them to emit the deprecation warning even |
| 161 | # with /W0. |
| 162 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS',extend_conditions(conditions,['<warnings>off']), ['/wd4996']) |
| 163 | if re.match('^[78]\\.', version): |
| 164 | # 64-bit compatibility warning deprecated since 9.0, see |
| 165 | # http://msdn.microsoft.com/en-us/library/yt4xw8fh.aspx |
| 166 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS',extend_conditions(conditions,['<warnings>all']), ['/Wp64']) |
| 167 | |
| 168 | # |
| 169 | # Processor-specific optimization. |
| 170 | # |
| 171 | if re.match('^[67]', version ): |
| 172 | # 8.0 deprecates some of the options. |
| 173 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<optimization>speed','<optimization>space']), ['/Ogiy', '/Gs']) |
| 174 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<optimization>speed']), ['/Ot']) |
| 175 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<optimization>space']), ['/Os']) |
| 176 | |
| 177 | cpu_arch_i386_cond = extend_conditions(conditions, __cpu_arch_i386) |
| 178 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(cpu_arch_i386_cond,['<instruction-set>']),['/GB']) |
| 179 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(cpu_arch_i386_cond,['<instruction-set>i486']),['/G4']) |
| 180 | |
| 181 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(cpu_arch_i386_cond,['<instruction-set>' + t for t in __cpu_type_g5]), ['/G5']) |
| 182 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(cpu_arch_i386_cond,['<instruction-set>' + t for t in __cpu_type_g6]), ['/G6']) |
| 183 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(cpu_arch_i386_cond,['<instruction-set>' + t for t in __cpu_type_g7]), ['/G7']) |
| 184 | |
| 185 | # Improve floating-point accuracy. Otherwise, some of C++ Boost's "math" |
| 186 | # tests will fail. |
| 187 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', conditions, ['/Op']) |
| 188 | |
| 189 | # 7.1 and below have single-threaded static RTL. |
| 190 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<runtime-debugging>off/<runtime-link>static/<threading>single']), ['/ML']) |
| 191 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<runtime-debugging>on/<runtime-link>static/<threading>single']), ['/MLd']) |
| 192 | else: |
| 193 | # 8.0 and above adds some more options. |
| 194 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions, [a + '/<instruction-set>' for a in __cpu_arch_amd64]), ['/favor:blend']) |
| 195 | |
| 196 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions, [a + '/<instruction-set>' + t for a in __cpu_arch_amd64 for t in __cpu_type_em64t]), ['/favor:EM64T']) |
| 197 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions, [a + '/<instruction-set>' + t for a in __cpu_arch_amd64 for t in __cpu_type_amd64]), ['/favor:AMD64']) |
| 198 | |
| 199 | # 8.0 and above only has multi-threaded static RTL. |
| 200 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<runtime-debugging>off/<runtime-link>static/<threading>single']), ['/MT']) |
| 201 | toolset.flags('{}.compile'.format(toolset_arg), 'CFLAGS', extend_conditions(conditions,['<runtime-debugging>on/<runtime-link>static/<threading>single']), ['/MTd']) |
| 202 | |
| 203 | # Specify target machine type so the linker will not need to guess. |
| 204 | toolset.flags('{}.link'.format(toolset_arg), 'LINKFLAGS', extend_conditions(conditions, __cpu_arch_amd64), ['/MACHINE:X64']) |
| 205 | toolset.flags('{}.link'.format(toolset_arg), 'LINKFLAGS', extend_conditions(conditions, __cpu_arch_i386), ['/MACHINE:X86']) |
| 206 | toolset.flags('{}.link'.format(toolset_arg), 'LINKFLAGS', extend_conditions(conditions, __cpu_arch_ia64), ['/MACHINE:IA64']) |
no test coverage detected