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) {