@@ -50,9 +50,6 @@ public class MsBuild {
5050 private static final String MSC_IX86_600 = "_M_IX86 600" ;
5151 private static final String MSC_X64_100 = "_M_X64 100" ;
5252
53- private static final String CPPWINRTVERSION = "__cplusplus_winrt=201009" ;
54- private static final String CPPVERSION = "__cplusplus=199711L" ;
55-
5653 private static final Pattern [] INCLUDE_PATTERNS = {Pattern .compile ("/I\" (.*?)\" " ),
5754 Pattern .compile ("/I([^\\ s\" ]++) " )};
5855 private static final Pattern [] DEFINE_PATTERNS = {Pattern .compile ("[/-]D\\ s([^\\ s]++)" ),
@@ -71,7 +68,7 @@ public class MsBuild {
7168 private static final Pattern PATH_TO_VCXPROJ = Pattern .compile (
7269 "^\\ S+\\ s\\ \" ClCompile\\ \" .+\\ \" ((?>[^\\ \\ ]{1,260}\\ \\ )*[^\\ \\ ]{1,260}\\ .vcxproj)\\ \" .*$" );
7370
74- private String platformToolset = "V120 " ;
71+ private String platformToolset = "V142 " ;
7572 private String platform = "Win32" ;
7673
7774 private final CxxSquidConfiguration squidConfig ;
@@ -543,95 +540,82 @@ private void parseCommonCompilerOptions(String line, String fileElement) {
543540 }
544541
545542 private void parseV100CompilerOptions (String line , String fileElement ) {
546- // VC++ V16.0 - VS2010 (V10.0)
547- addMacro (CPPVERSION , fileElement );
543+ // Visual Studio 2010 SP1 [10.0]
544+ addMacro ("__cplusplus=199711L" , fileElement );
548545 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
549546 if (line .contains ("/ZW " )) {
550- addMacro (CPPWINRTVERSION , fileElement );
547+ addMacro ("__cplusplus_winrt=201009" , fileElement );
551548 }
552549 addMacro ("_MSC_VER=1600" , fileElement );
553- // VS2010 SP1
554- addMacro ("_MSC_FULL_VER=16004021901" , fileElement );
555- //_MFC_VER Defines the MFC version. For example, in Visual Studio 2010, _MFC_VER is defined as 0x0C00.
550+ addMacro ("_MSC_FULL_VER=160040219" , fileElement );
556551 addMacro ("_MFC_VER=0x0A00" , fileElement );
557552 addMacro ("_ATL_VER=0x0A00" , fileElement );
558- // VC++ 16.0
559553 if (line .contains ("/GX " )) {
560554 addMacro ("_CPPUNWIND" , fileElement );
561555 }
562556 }
563557
564558 private void parseV110CompilerOptions (String line , String fileElement ) {
565- // VC++ V17.0 - VS2012 (V11.0)
566- addMacro (CPPVERSION , fileElement );
559+ // Visual Studio 2012 Update 4 [11.0]
560+ addMacro ("__cplusplus=199711L" , fileElement );
567561 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
568562 if (line .contains ("/ZW " )) {
569- addMacro (CPPWINRTVERSION , fileElement );
563+ addMacro ("__cplusplus_winrt=201009" , fileElement );
570564 }
571565 addMacro ("_MSC_VER=1700" , fileElement );
572- // VS2012 Update 4
573- addMacro ("_MSC_FULL_VER=1700610301" , fileElement );
574- //_MFC_VER Defines the MFC version (see afxver_.h)
566+ addMacro ("_MSC_FULL_VER=170061030" , fileElement );
575567 addMacro ("_MFC_VER=0x0B00" , fileElement );
576568 addMacro ("_ATL_VER=0x0B00" , fileElement );
577569 }
578570
579571 private void parseV120CompilerOptions (String line , String fileElement ) {
580- // VC++ V18.0 - VS2013 (V12.0)
581- addMacro (CPPVERSION , fileElement );
572+ // Visual Studio 2013 Update 5 [12.0]
573+ addMacro ("__cplusplus=199711L" , fileElement );
582574 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
583575 if (line .contains ("/ZW " )) {
584- addMacro (CPPWINRTVERSION , fileElement );
576+ addMacro ("__cplusplus_winrt=201009" , fileElement );
585577 }
586578 addMacro ("_MSC_VER=1800" , fileElement );
587- // VS2013 Update 4
588- addMacro ("_MSC_FULL_VER=180031101" , fileElement );
589- //_MFC_VER Defines the MFC version (see afxver_.h)
579+ addMacro ("_MSC_FULL_VER=180040629" , fileElement );
590580 addMacro ("_MFC_VER=0x0C00" , fileElement );
591581 addMacro ("_ATL_VER=0x0C00" , fileElement );
592582 }
593583
594584 private void parseV140CompilerOptions (String line , String fileElement ) {
595- // VC++ V19.0 - VS2015 (V14.0)
596- addMacro (CPPVERSION , fileElement );
585+ // Visual Studio 2015 Update 3 [14.0]
586+ addMacro ("__cplusplus=199711L" , fileElement );
597587 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
598588 if (line .contains ("/ZW " )) {
599- addMacro (CPPWINRTVERSION , fileElement );
589+ addMacro ("__cplusplus_winrt=201009" , fileElement );
600590 }
601591 addMacro ("_MSC_VER=1900" , fileElement );
602- // VS2015 Update 3 V19.00.24215.1
603- addMacro ("_MSC_FULL_VER=190024215" , fileElement );
604- //_MFC_VER Defines the MFC version (see afxver_.h)
592+ addMacro ("_MSC_FULL_VER=190024210" , fileElement );
605593 addMacro ("_MFC_VER=0x0E00" , fileElement );
606594 addMacro ("_ATL_VER=0x0E00" , fileElement );
607595 }
608596
609597 private void parseV141CompilerOptions (String line , String fileElement ) {
610- // VC++ V19.1 - VS2017 (V15.0)
611- addMacro (CPPVERSION , fileElement );
598+ // Visual Studio 2017 version 15.9.11
599+ addMacro ("__cplusplus=199711L" , fileElement );
612600 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
613601 if (line .contains ("/ZW " )) {
614- addMacro (CPPWINRTVERSION , fileElement );
602+ addMacro ("__cplusplus_winrt=201009" , fileElement );
615603 }
616604 addMacro ("_MSC_VER=1910" , fileElement );
617- // VS2017 RC
618- addMacro ("_MSC_FULL_VER=191024629" , fileElement );
619- //_MFC_VER Defines the MFC version (see afxver_.h)
605+ addMacro ("_MSC_FULL_VER=191627030" , fileElement );
620606 addMacro ("_MFC_VER=0x0E00" , fileElement );
621607 addMacro ("_ATL_VER=0x0E00" , fileElement );
622608 }
623609
624610 private void parseV142CompilerOptions (String line , String fileElement ) {
625- // VC++ V19.2 - VS2019 (V16.0)
626- addMacro (CPPVERSION , fileElement );
611+ // Visual Studio 2019 version 16.9.2
612+ addMacro ("__cplusplus=201402L" , fileElement );
627613 // __cplusplus_winrt Defined when you use the /ZW option to compile. The value of __cplusplus_winrt is 201009.
628614 if (line .contains ("/ZW " )) {
629- addMacro (CPPWINRTVERSION , fileElement );
615+ addMacro ("__cplusplus_winrt=201009" , fileElement );
630616 }
631- addMacro ("_MSC_VER=1921" , fileElement );
632- // VS2017 RC
633- addMacro ("_MSC_FULL_VER=192127702" , fileElement );
634- //_MFC_VER Defines the MFC version (see afxver_.h)
617+ addMacro ("_MSC_VER=1920" , fileElement );
618+ addMacro ("_MSC_FULL_VER=192829913" , fileElement );
635619 addMacro ("_MFC_VER=0x0E00" , fileElement );
636620 addMacro ("_ATL_VER=0x0E00" , fileElement );
637621 }
0 commit comments