forked from qt-creator/qt-creator
CMake: Fix missing path to ninja for ExternalProject_Add
ExternalProject_Add runs CMake not during the CMake run of the toplevel project, but instead it runs CMake for the external project during the build step. And while ExternalProject passes the CMAKE_COMMAND on to the external project, it does not do so for the CMAKE_MAKE_PROGRAM. Make sure that the make program is also found when configuring the external project during the build step, by adding the path to ninja to the build environment, instead of just the CMake process. Fixes: QTCREATORBUG-27495 Change-Id: I672ec04881387a7411836ab94655176b7a5fb681 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -89,12 +89,6 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem)
|
||||
if (Utils::HostOsInfo::isAnyUnixHost())
|
||||
environment.set("ICECC", "no");
|
||||
|
||||
CMakeSpecificSettings *settings = CMakeProjectPlugin::projectTypeSpecificSettings();
|
||||
if (!settings->ninjaPath.filePath().isEmpty()) {
|
||||
const Utils::FilePath ninja = settings->ninjaPath.filePath();
|
||||
environment.appendOrSetPath(ninja.isFile() ? ninja.parentDir() : ninja);
|
||||
}
|
||||
|
||||
cmakeToolId = CMakeKitAspect::cmakeToolId(k);
|
||||
}
|
||||
|
||||
|
@@ -1714,6 +1714,15 @@ FilePath CMakeBuildConfiguration::sourceDirectory() const
|
||||
return aspect<SourceDirectoryAspect>()->filePath();
|
||||
}
|
||||
|
||||
void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
CMakeSpecificSettings *settings = CMakeProjectPlugin::projectTypeSpecificSettings();
|
||||
if (!settings->ninjaPath.filePath().isEmpty()) {
|
||||
const Utils::FilePath ninja = settings->ninjaPath.filePath();
|
||||
env.appendOrSetPath(ninja.isFile() ? ninja.parentDir() : ninja);
|
||||
}
|
||||
}
|
||||
|
||||
QString CMakeBuildSystem::cmakeBuildType() const
|
||||
{
|
||||
auto setBuildTypeFromConfig = [this](const CMakeConfig &config) {
|
||||
|
@@ -64,6 +64,8 @@ public:
|
||||
void setSourceDirectory(const Utils::FilePath& path);
|
||||
Utils::FilePath sourceDirectory() const;
|
||||
|
||||
void addToEnvironment(Utils::Environment &env) const override;
|
||||
|
||||
signals:
|
||||
void signingFlagsChanged();
|
||||
|
||||
|
Reference in New Issue
Block a user