forked from qt-creator/qt-creator
CMakePM: Do not use systemEnvironment() for CMakePresets
This doesn't mean that CMakePresets will work with a remote project, but at least it avoids Environment::systemEnvironment() usage. Change-Id: I17081c747d32e50224ac74507d3aa336ff5c8948 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -135,7 +135,7 @@ FilePaths CMakeProjectImporter::importCandidates()
|
||||
// If the binaryFilePath exists, do not try to import the existing build, so that
|
||||
// we don't have duplicates, one from the preset and one from the previous configuration.
|
||||
if (configPreset.binaryDir) {
|
||||
Environment env = Environment::systemEnvironment();
|
||||
Environment env = projectDirectory().deviceEnvironment();
|
||||
CMakePresets::Macros::expand(configPreset, env, projectDirectory());
|
||||
|
||||
QString binaryDir = configPreset.binaryDir.value();
|
||||
@@ -165,15 +165,15 @@ static CMakeConfig configurationFromPresetProbe(
|
||||
cmake.setTimeoutS(30);
|
||||
cmake.setDisableUnixTerminal();
|
||||
|
||||
Environment env = Environment::systemEnvironment();
|
||||
const FilePath cmakeExecutable = FilePath::fromString(configurePreset.cmakeExecutable.value());
|
||||
|
||||
Environment env = cmakeExecutable.deviceEnvironment();
|
||||
CMakePresets::Macros::expand(configurePreset, env, importPath);
|
||||
|
||||
env.setupEnglishOutput();
|
||||
cmake.setEnvironment(env);
|
||||
cmake.setTimeOutMessageBoxEnabled(false);
|
||||
|
||||
const FilePath cmakeExecutable = FilePath::fromString(configurePreset.cmakeExecutable.value());
|
||||
|
||||
QStringList args;
|
||||
args.emplace_back("-S");
|
||||
args.emplace_back(importPath.path());
|
||||
@@ -428,7 +428,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
|
||||
return preset.name == presetName;
|
||||
});
|
||||
|
||||
Environment env = Environment::systemEnvironment();
|
||||
Environment env = projectDirectory().deviceEnvironment();
|
||||
CMakePresets::Macros::expand(configurePreset, env, projectDirectory());
|
||||
|
||||
if (configurePreset.displayName)
|
||||
|
@@ -280,7 +280,7 @@ bool evaluatePresetCondition(const PresetType &preset, const Utils::FilePath &so
|
||||
if (!preset.condition)
|
||||
return true;
|
||||
|
||||
Utils::Environment env = Utils::Environment::systemEnvironment();
|
||||
Utils::Environment env = sourceDirectory.deviceEnvironment();
|
||||
expand(preset, env, sourceDirectory);
|
||||
|
||||
PresetsDetails::Condition condition = preset.condition.value();
|
||||
|
Reference in New Issue
Block a user