Skip to content

Commit ee02ebe

Browse files
authored
tools/msvc.jam regexp review (#499)
1 parent c4ba452 commit ee02ebe

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/tools/msvc.jam

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ rule configure-version-specific ( toolset : version : conditions )
483483
# 12.0 (VS2013 Update 2) introduced /Zc:inline opt-in standard conformance
484484
# compiler flag that also similar to linker /opt:ref removes unreferenced
485485
# variables and functions that have internal linkage
486-
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 12 ]
486+
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0-9.]+)" : $(version) ] : . ] : 12 ]
487487
{
488488
toolset.flags $(toolset).compile OPTIONS $(conditions) : "/Zc:inline" ;
489489

@@ -493,14 +493,14 @@ rule configure-version-specific ( toolset : version : conditions )
493493

494494
# 14.0 introduced /Zc:throwingNew opt-in flag that disables a workaround
495495
# for not throwing operator new in VC up to 6.0
496-
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 ]
496+
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0-9.]+)" : $(version) ] : . ] : 14 ]
497497
{
498498
toolset.flags $(toolset).compile C++FLAGS $(conditions) : "/Zc:throwingNew" ;
499499
}
500500

501501
# 14.27 (VS2019 Version 16.7) introduced support for ASAN on x86 and x64 CPUs
502502
# This check however now only tests for 14.2 (which is 16.0) as msvc.jam doesn't distinguish between minor versions (e.g. 14.21..14.28 etc)
503-
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 14 2 ]
503+
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0-9.]+)" : $(version) ] : . ] : 14 2 ]
504504
{
505505
# General asan compile and link options.
506506
toolset.flags $(toolset).compile OPTIONS
@@ -613,7 +613,7 @@ rule configure-version-specific ( toolset : version : conditions )
613613
toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-arm64) : "/MACHINE:ARM64" ;
614614

615615
local conditionx = [ feature.split $(conditions) ] ;
616-
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0123456789.]+)" : $(version) ] : . ] : 11 ] {
616+
if ! [ version.version-less [ SPLIT_BY_CHARACTERS [ MATCH "^([0-9.]+)" : $(version) ] : . ] : 11 ] {
617617
toolset.add-defaults $(conditionx:J=,)\:<embed-manifest-via>linker ;
618618
}
619619
else {
@@ -1155,31 +1155,31 @@ local rule generate-setup-cmd ( version : command : parent : options * : cpu : g
11551155
}
11561156
else
11571157
{
1158-
if [ MATCH "(14.5)" : $(version) ]
1158+
if [ MATCH "(14\\.5)" : $(version) ]
11591159
{
11601160
if $(.debug-configuration)
11611161
{
11621162
ECHO "notice: [generate-setup-cmd] $(version) is 14.5" ;
11631163
}
11641164
parent = [ path.native [ path.join $(parent) "..\\..\\..\\..\\..\\Auxiliary\\Build" ] ] ;
11651165
}
1166-
else if [ MATCH "(14.[34])" : $(version) ]
1166+
else if [ MATCH "(14\\.[34])" : $(version) ]
11671167
{
11681168
if $(.debug-configuration)
11691169
{
11701170
ECHO "notice: [generate-setup-cmd] $(version) is 14.3" ;
11711171
}
11721172
parent = [ path.native [ path.join $(parent) "..\\..\\..\\..\\..\\Auxiliary\\Build" ] ] ;
11731173
}
1174-
else if [ MATCH "(14.2)" : $(version) ]
1174+
else if [ MATCH "(14\\.2)" : $(version) ]
11751175
{
11761176
if $(.debug-configuration)
11771177
{
11781178
ECHO "notice: [generate-setup-cmd] $(version) is 14.2" ;
11791179
}
11801180
parent = [ path.native [ path.join $(parent) "..\\..\\..\\..\\..\\Auxiliary\\Build" ] ] ;
11811181
}
1182-
else if [ MATCH "(14.1)" : $(version) ]
1182+
else if [ MATCH "(14\\.1)" : $(version) ]
11831183
{
11841184
if $(.debug-configuration)
11851185
{
@@ -1349,19 +1349,19 @@ local rule configure-really ( version ? : options * )
13491349
# version from the path.
13501350
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
13511351
# 9.0express as 9.0 here.
1352-
if [ MATCH "(MSVC(\\/|\\\\)14.5)" : $(command) ]
1352+
if [ MATCH "(MSVC(\\/|\\\\)14\\.5)" : $(command) ]
13531353
{
13541354
version = 14.5 ;
13551355
}
1356-
else if [ MATCH "(MSVC(\\/|\\\\)14.[34])" : $(command) ]
1356+
else if [ MATCH "(MSVC(\\/|\\\\)14\\.[34])" : $(command) ]
13571357
{
13581358
version = 14.3 ;
13591359
}
1360-
else if [ MATCH "(MSVC(\\/|\\\\)14.2)" : $(command) ]
1360+
else if [ MATCH "(MSVC(\\/|\\\\)14\\.2)" : $(command) ]
13611361
{
13621362
version = 14.2 ;
13631363
}
1364-
else if [ MATCH "(MSVC(\\/|\\\\)14.1)" : $(command) ]
1364+
else if [ MATCH "(MSVC(\\/|\\\\)14\\.1)" : $(command) ]
13651365
{
13661366
version = 14.1 ;
13671367
}
@@ -1389,7 +1389,7 @@ local rule configure-really ( version ? : options * )
13891389
{
13901390
version = 8.0 ;
13911391
}
1392-
else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ]
1392+
else if [ MATCH "(NET 2003[/\\]VC7)" : $(command) ]
13931393
{
13941394
version = 7.1 ;
13951395
}
@@ -1398,7 +1398,7 @@ local rule configure-really ( version ? : options * )
13981398
{
13991399
version = 7.1toolkit ;
14001400
}
1401-
else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
1401+
else if [ MATCH "(.NET[/\\]VC7)" : $(command) ]
14021402
{
14031403
version = 7.0 ;
14041404
}
@@ -1440,7 +1440,7 @@ local rule configure-really ( version ? : options * )
14401440

14411441
# For 14.1+ we need the exact version as MS is planning rolling updates
14421442
# that will cause our `setup-cmd` to become invalid
1443-
exact-version = [ MATCH "(14\.[1-9][0-9]\.[0-9\.]+)" : $(command) ] ;
1443+
exact-version = [ MATCH "(14\\.[1-9][0-9]\\.[0-9\.]+)" : $(command) ] ;
14441444

14451445
common.handle-options msvc : $(conditions) : $(command) : $(options) ;
14461446

@@ -1583,11 +1583,11 @@ local rule configure-really ( version ? : options * )
15831583
# each of which have a different directory for their vcvars setup scripts.
15841584
local phone-parent = [ path.native [ path.join $(parent) WPSDK ] ] ;
15851585
local phone-directory = $(phone-parent) ;
1586-
if [ MATCH "(11.0)" : $(version) ]
1586+
if [ MATCH "(11\\.0)" : $(version) ]
15871587
{
15881588
phone-directory = [ path.native [ path.join $(phone-directory) WP80 ] ] ;
15891589
}
1590-
else if [ MATCH "(12.0)" : $(version) ]
1590+
else if [ MATCH "(12\\.0)" : $(version) ]
15911591
{
15921592
phone-directory = [ path.native [ path.join $(phone-directory) WP81 ] ] ;
15931593
}

0 commit comments

Comments
 (0)