From cf8d34c49239d3962b535f7fbbc388feb1feeff4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Dec 2017 08:46:41 +0200 Subject: Update Apple Clang to vanilla Clang version remapping (up to Xcode 9.2) --- build2/cxx/init.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'build2/cxx') 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;} } -- cgit v1.1