@ -17,13 +17,11 @@ namespace O3DE::ProjectManager
namespace ProjectUtils
{
// The list of clang C/C++ compiler command lines to validate on the host Linux system
const QStringList SupportedClang Commands = { " clang-12|clang++-12 " } ;
const QStringList SupportedClang Versions = { " 13 " , " 12 " , " 11 " , " 10 " , " 9 " , " 8 " , " 7 " , " 6.0 " } ;
AZ : : Outcome < QProcessEnvironment , QString > GetCommandLineProcessEnvironment ( )
{
QProcessEnvironment currentEnvironment ( QProcessEnvironment : : systemEnvironment ( ) ) ;
currentEnvironment . insert ( " CC " , " clang-12 " ) ;
currentEnvironment . insert ( " CXX " , " clang++-12 " ) ;
return AZ : : Success ( currentEnvironment ) ;
}
@ -39,16 +37,13 @@ namespace O3DE::ProjectManager
}
// Look for the first compatible version of clang. The list below will contain the known clang compilers that have been tested for O3DE.
for ( const QString & supportClang Command : SupportedClangCommand s)
for ( const QString & supportClang Version : SupportedClangVersion s)
{
auto clangCompilers = supportClangCommand . split ( ' | ' ) ;
AZ_Assert ( clangCompilers . length ( ) = = 2 , " Invalid clang compiler pair specification " ) ;
auto whichClangResult = ProjectUtils : : ExecuteCommandResult ( " which " , QStringList { clangCompilers [ 0 ] } , QProcessEnvironment : : systemEnvironment ( ) ) ;
auto whichClangPPResult = ProjectUtils : : ExecuteCommandResult ( " which " , QStringList { clangCompilers [ 1 ] } , QProcessEnvironment : : systemEnvironment ( ) ) ;
auto whichClangResult = ProjectUtils : : ExecuteCommandResult ( " which " , QStringList { QString ( " clang-%1 " ) . arg ( supportClangVersion ) } , QProcessEnvironment : : systemEnvironment ( ) ) ;
auto whichClangPPResult = ProjectUtils : : ExecuteCommandResult ( " which " , QStringList { QString ( " clang++-%1 " ) . arg ( supportClangVersion ) } , QProcessEnvironment : : systemEnvironment ( ) ) ;
if ( whichClangResult . IsSuccess ( ) & & whichClangPPResult . IsSuccess ( ) )
{
return AZ : : Success ( supportClangCommand ) ;
return AZ : : Success ( QString ( " clang-%1 " ) . arg ( supportClangVersion ) ) ;
}
}
return AZ : : Failure ( QObject : : tr ( " Clang not found. <br><br> "