aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-15 08:46:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-15 08:46:41 +0200
commitcf8d34c49239d3962b535f7fbbc388feb1feeff4 (patch)
treeb20fe766329ed3dc636853b81f92f0717f40725b
parent68dde99b399290c6cbdf79dbaa0bb77356b3d247 (diff)
Update Apple Clang to vanilla Clang version remapping (up to Xcode 9.2)
-rw-r--r--build2/cxx/init.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx
index c7d6fd9..9870d84 100644
--- a/build2/cxx/init.cxx
+++ b/build2/cxx/init.cxx
@@ -97,17 +97,29 @@ namespace build2
case compiler_id::clang_apple:
{
// Remap Apple versions to vanilla Clang based on the following
- // release point:
+ // release point. Note that Apple no longer discloses the mapping
+ // so it's a guesswork and we try to be conservative. For details
+ // see:
+ //
+ // https://gist.github.com/yamaya/2924292
//
// 5.1 -> 3.4
// 6.0 -> 3.5
+ // 7.0 -> 3.7
+ // 7.3 -> 3.8
+ // 8.0 -> 3.9
+ // 9.0 -> 4.0 (later ones could be 5.0)
//
// Note that this mapping is also used to enable experimental
// features below.
//
if (id == compiler_id::clang_apple)
{
- if (mj >= 6) {mj = 3; mi = 5;}
+ if (mj >= 9) {mj = 4; mi = 0;}
+ else if (mj == 8) {mj = 3; mi = 9;}
+ else if (mj == 7 && mi >= 3) {mj = 3; mi = 8;}
+ else if (mj == 7) {mj = 3; mi = 7;}
+ else if (mj == 6) {mj = 3; mi = 5;}
else if (mj == 5 && mi >= 1) {mj = 3; mi = 4;}
else {mj = 3; mi = 0;}
}