From 9377466ec883faba5e1f4e1dfd7a5317da39e3f2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 22 Apr 2023 18:31:25 +0200 Subject: [PATCH] Allow newer clang versions on Linux --- .../Platforms/Linux/LinuxPlatform.cs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Source/Tools/Flax.Build/Platforms/Linux/LinuxPlatform.cs b/Source/Tools/Flax.Build/Platforms/Linux/LinuxPlatform.cs index f7a0417b3..eb15bdc0b 100644 --- a/Source/Tools/Flax.Build/Platforms/Linux/LinuxPlatform.cs +++ b/Source/Tools/Flax.Build/Platforms/Linux/LinuxPlatform.cs @@ -42,18 +42,23 @@ namespace Flax.Build.Platforms // Pick the newest compiler (overriden by specified in command line) if (Which(Compiler) != null) Compiler = Configuration.Compiler; - else if (Which("clang++-10") != null) - Compiler = "clang++-10"; - else if (Which("clang++-9") != null) - Compiler = "clang++-9"; - else if (Which("clang++-8") != null) - Compiler = "clang++-8"; - else if (Which("clang++-7") != null) - Compiler = "clang++-7"; - else if (Which("clang++-6") != null) - Compiler = "clang++-6"; - else if (Which("clang++") != null) - Compiler = "clang++"; + else + { + for (int ver = 15; ver >= 6; ver--) + { + var compiler = "clang++-" + ver; + if (Which(compiler) != null) + { + Compiler = compiler; + break; + } + } + if (Compiler == null) + { + if (Which("clang++") != null) + Compiler = "clang++"; + } + } } if (Compiler != null) {