From b296b1fc43bbb115d9e826d02a7aca09e713b422 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 26 Nov 2016 01:33:50 +0300 Subject: Add support for VC15 --- build2/bin/target.cxx | 2 +- build2/cc/guess.cxx | 32 +++++++++++++++++++------------- build2/cc/target.cxx | 2 +- build2/cli/target.cxx | 2 +- build2/cxx/target.cxx | 2 +- build2/function | 12 ++++++------ build2/function.cxx | 2 +- build2/scope.cxx | 2 +- build2/target.cxx | 4 ++-- build2/variable | 2 +- build2/variable.txx | 4 ++-- 11 files changed, 36 insertions(+), 30 deletions(-) diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx index f2ebd05..770afbb 100644 --- a/build2/bin/target.cxx +++ b/build2/bin/target.cxx @@ -10,7 +10,7 @@ namespace build2 { namespace bin { - extern const char ext_var[] = "extension"; // VC 19 rejects constexpr. + extern const char ext_var[] = "extension"; // VC14 rejects constexpr. static target* obje_factory (const target_type&, diff --git a/build2/cc/guess.cxx b/build2/cc/guess.cxx index b153cc1..b87dd1f 100644 --- a/build2/cc/guess.cxx +++ b/build2/cc/guess.cxx @@ -282,6 +282,7 @@ namespace build2 // Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86 // Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86 // Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86 + // Microsoft (R) C/C++ Optimizing Compiler Version 19.10.24629 for x86 // // In the recent versions the architecture is either "x86", "x64", // or "ARM". @@ -1001,20 +1002,25 @@ namespace build2 // Mapping of compiler versions to runtime versions: // - // 19.00 140/14.0 VS2015 - // 18.00 120/12.0 VS2013 - // 17.00 110/11.0 VS2012 - // 16.00 100/10.0 VS2010 - // 15.00 90/9.0 VS2008 - // 14.00 80/8.0 VS2005 - // 13.10 71/7.1 VS2003 + // Note that VC15 has runtime version 14.1 but the DLLs are still + // called *140.dll (they are said to be backwards-compatible). // - /**/ if (v.major == 19 && v.minor == 0) arch += "14.0"; - else if (v.major == 18 && v.minor == 0) arch += "12.0"; - else if (v.major == 17 && v.minor == 0) arch += "11.0"; - else if (v.major == 16 && v.minor == 0) arch += "10.0"; - else if (v.major == 15 && v.minor == 0) arch += "9.0"; - else if (v.major == 14 && v.minor == 0) arch += "8.0"; + // 19.10 140/14.1 15/2017 + // 19.00 140/14.0 14/2015 + // 18.00 120/12.0 12/2013 + // 17.00 110/11.0 11/2012 + // 16.00 100/10.0 10/2010 + // 15.00 90/9.0 9/2008 + // 14.00 80/8.0 8/2005 + // 13.10 71/7.1 7.1/2003 + // + /**/ if (v.major == 19 && v.minor == 10) arch += "14.1"; + else if (v.major == 19 && v.minor == 0) arch += "14.0"; + else if (v.major == 18 && v.minor == 0) arch += "12.0"; + else if (v.major == 17 && v.minor == 0) arch += "11.0"; + else if (v.major == 16 && v.minor == 0) arch += "10.0"; + else if (v.major == 15 && v.minor == 0) arch += "9.0"; + else if (v.major == 14 && v.minor == 0) arch += "8.0"; else if (v.major == 13 && v.minor == 10) arch += "7.1"; else fail << "unable to map msvc compiler version '" << v.string << "' to runtime version"; diff --git a/build2/cc/target.cxx b/build2/cc/target.cxx index 4961b35..0674ade 100644 --- a/build2/cc/target.cxx +++ b/build2/cc/target.cxx @@ -21,7 +21,7 @@ namespace build2 false }; - extern const char ext_var[] = "extension"; // VC 19 rejects constexpr. + extern const char ext_var[] = "extension"; // VC14 rejects constexpr. extern const char h_ext_def[] = "h"; const target_type h::static_type diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx index 7432bef..a14cea4 100644 --- a/build2/cli/target.cxx +++ b/build2/cli/target.cxx @@ -15,7 +15,7 @@ namespace build2 { // cli // - extern const char cli_ext_var[] = "extension"; // VC 19 rejects constexpr. + extern const char cli_ext_var[] = "extension"; // VC14 rejects constexpr. extern const char cli_ext_def[] = "cli"; const target_type cli::static_type diff --git a/build2/cxx/target.cxx b/build2/cxx/target.cxx index e9733a8..7189f9a 100644 --- a/build2/cxx/target.cxx +++ b/build2/cxx/target.cxx @@ -10,7 +10,7 @@ namespace build2 { namespace cxx { - extern const char ext_var[] = "extension"; // VC 19 rejects constexpr. + extern const char ext_var[] = "extension"; // VC14 rejects constexpr. extern const char hxx_ext_def[] = "hxx"; const target_type hxx::static_type diff --git a/build2/function b/build2/function index 192c4a3..6397720 100644 --- a/build2/function +++ b/build2/function @@ -116,10 +116,10 @@ namespace build2 D d) : function_overload (an, mi, ma, move (ts), im) { - // std::is_pod appears to be broken in VC14 and also in GCC up to + // std::is_pod appears to be broken in VC15 and also in GCC up to // 5 (pointers to members). // -#if !((defined(_MSC_VER) && _MSC_VER <= 1900) || \ +#if !((defined(_MSC_VER) && _MSC_VER <= 1910) || \ (defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5)) static_assert (std::is_pod::value, "type is not POD"); #endif @@ -327,10 +327,10 @@ namespace build2 static const size_t max = sizeof...(A); static const size_t min = max - function_args_opt::count; - // VC14 doesn't realize that a pointer to static object (in our case it is + // VC15 doesn't realize that a pointer to static object (in our case it is // &value_trair::value_type) is constexpr. // -#if !defined(_MSC_VER) || _MSC_VER > 1900 +#if !defined(_MSC_VER) || _MSC_VER > 1910 static constexpr const optional types[max] = { function_arg::type ()...}; #else @@ -339,7 +339,7 @@ namespace build2 }; template -#if !defined(_MSC_VER) || _MSC_VER > 1900 +#if !defined(_MSC_VER) || _MSC_VER > 1910 constexpr const optional function_args::types[function_args::max]; #else @@ -356,7 +356,7 @@ namespace build2 static const size_t max = 0; static const size_t min = 0; -#if !defined(_MSC_VER) || _MSC_VER > 1900 +#if !defined(_MSC_VER) || _MSC_VER > 1910 static constexpr const optional* types = nullptr; #else static const optional* const types; diff --git a/build2/function.cxx b/build2/function.cxx index e76f0c2..bede978 100644 --- a/build2/function.cxx +++ b/build2/function.cxx @@ -250,7 +250,7 @@ namespace build2 dr << endf; } -#if !defined(_MSC_VER) || _MSC_VER > 1900 +#if !defined(_MSC_VER) || _MSC_VER > 1910 constexpr const optional* function_args<>::types; #else const optional* const function_args<>::types = nullptr; diff --git a/build2/scope.cxx b/build2/scope.cxx index 2ca382b..c9a9fdd 100644 --- a/build2/scope.cxx +++ b/build2/scope.cxx @@ -644,7 +644,7 @@ namespace build2 return r; } - // VC 19 rejects constexpr. + // VC14 rejects constexpr. // extern const char derived_tt_ext_var[] = "extension"; diff --git a/build2/target.cxx b/build2/target.cxx index 75485ed..126159c 100644 --- a/build2/target.cxx +++ b/build2/target.cxx @@ -538,7 +538,7 @@ namespace build2 : &extension_pool.find (ext))); } - extern const char file_ext_var[] = "extension"; // VC 19 rejects constexpr. + extern const char file_ext_var[] = "extension"; // VC14 rejects constexpr. extern const char file_ext_def[] = ""; const target_type file::static_type @@ -653,7 +653,7 @@ namespace build2 false }; - extern const char man1_ext[] = "1"; // VC 19 rejects constexpr. + extern const char man1_ext[] = "1"; // VC14 rejects constexpr. const target_type man1::static_type { diff --git a/build2/variable b/build2/variable index dd4f551..9eb173a 100644 --- a/build2/variable +++ b/build2/variable @@ -237,7 +237,7 @@ namespace build2 // std::aligned_storage::type data_; - // VC 19 needs decltype. + // VC14 needs decltype. // static const size_t size_ = sizeof (decltype (data_)); diff --git a/build2/variable.txx b/build2/variable.txx index 7d16408..0678a6a 100644 --- a/build2/variable.txx +++ b/build2/variable.txx @@ -321,7 +321,7 @@ namespace build2 value_traits::type_name) + 's'; template - const value_type value_traits>::value_type = // VC 19 wants =. + const value_type value_traits>::value_type = // VC14 wants =. { value_traits>::type_name.c_str (), sizeof (vector), @@ -481,7 +481,7 @@ namespace build2 value_traits::type_name + "_map"; template - const value_type value_traits>::value_type = // VC 19 wants =. + const value_type value_traits>::value_type = // VC14 wants =. { value_traits>::type_name.c_str (), sizeof (map), -- cgit v1.1