diff options
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/cxx/init.cxx | 11 | ||||
-rw-r--r-- | libbuild2/depdb.hxx | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx index ad0dd05..e2d7343 100644 --- a/libbuild2/cxx/init.cxx +++ b/libbuild2/cxx/init.cxx @@ -189,6 +189,17 @@ namespace build2 if (!o.empty ()) prepend (move (o)); + // Since VC 15.7 we can get a (more) accurate __cplusplus value if + // we ask for it with /Zc:__cplusplus: + // + // https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ + // + if (mj > 19 || (mj == 19 && mi >= 14)) + { + if (!find_option_prefix ("/Zc:__cplusplus", mode)) + prepend ("/Zc:__cplusplus"); + } + break; } case compiler_class::gcc: diff --git a/libbuild2/depdb.hxx b/libbuild2/depdb.hxx index ecc1f38..abc2565 100644 --- a/libbuild2/depdb.hxx +++ b/libbuild2/depdb.hxx @@ -55,9 +55,10 @@ namespace build2 // // If we assume that an update of the database also means an update of the // target, then this "interrupted update" situation can be easily detected - // by comparing the database and target modification timestamps. This is - // also used to handle the dry-run mode where we essentially do the - // interruption ourselves. + // by comparing the database and target modification timestamps: a valid + // up-to-date state will always have the target mtime greater or equal to + // the depdb mtime. This is also used to handle the dry-run mode where we + // essentially do the interruption ourselves. // struct LIBBUILD2_SYMEXPORT depdb_base { |