diff --git a/Code/Tools/ProjectManager/Platform/Linux/ProjectUtils_linux.cpp b/Code/Tools/ProjectManager/Platform/Linux/ProjectUtils_linux.cpp index a7bd2dae08..f9a1906b8a 100644 --- a/Code/Tools/ProjectManager/Platform/Linux/ProjectUtils_linux.cpp +++ b/Code/Tools/ProjectManager/Platform/Linux/ProjectUtils_linux.cpp @@ -19,10 +19,9 @@ namespace O3DE::ProjectManager // The list of clang C/C++ compiler command lines to validate on the host Linux system const QStringList SupportedClangVersions = {"13", "12", "11", "10", "9", "8", "7", "6.0"}; - AZ::Outcome GetCommandLineProcessEnvironment() + AZ::Outcome SetupCommandLineProcessEnvironment() { - QProcessEnvironment currentEnvironment(QProcessEnvironment::systemEnvironment()); - return AZ::Success(currentEnvironment); + return AZ::Success(); } AZ::Outcome FindSupportedCompilerForPlatform() diff --git a/Code/Tools/ProjectManager/Platform/Mac/ProjectUtils_mac.cpp b/Code/Tools/ProjectManager/Platform/Mac/ProjectUtils_mac.cpp index 62011bf04b..24a8fc1ff8 100644 --- a/Code/Tools/ProjectManager/Platform/Mac/ProjectUtils_mac.cpp +++ b/Code/Tools/ProjectManager/Platform/Mac/ProjectUtils_mac.cpp @@ -18,17 +18,20 @@ namespace O3DE::ProjectManager { namespace ProjectUtils { - AZ::Outcome GetCommandLineProcessEnvironment() + AZ::Outcome GetCommandLineProcessEnvironment() { // For CMake on Mac, if its installed through home-brew, then it will be installed // under /usr/local/bin, which may not be in the system PATH environment. // Add that path for the command line process so that it will be able to locate // a home-brew installed version of CMake - QProcessEnvironment currentEnvironment(QProcessEnvironment::systemEnvironment()); - QString pathValue = currentEnvironment.value("PATH"); - pathValue += ":/usr/local/bin"; - currentEnvironment.insert("PATH", pathValue); - return AZ::Success(currentEnvironment); + QString pathEnv = qEnvironmentVariable("PATH"); + if (!pathEnv.contains("/usr/local/bin")) + { + pathEnv += ":/usr/local/bin"; + qputenv("PATH", pathEnv.toStdString().c_str()); + } + + return AZ::Success(); } AZ::Outcome FindSupportedCompilerForPlatform()