CMake: honor use jom instead of nmake setting

Only search for the jom cmake generator if this setting is
enabled.

Change-Id: Id8eed91d47f1f6ca2375fe0d169b21168c5ca4ff
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
David Schulz
2020-04-17 08:53:16 +02:00
parent 169c3bb30c
commit 2aac4cc07f

View File

@@ -33,10 +33,12 @@
#include <app/app_version.h>
#include <coreplugin/icore.h>
#include <coreplugin/variablechooser.h>
#include <projectexplorer/task.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorersettings.h>
#include <projectexplorer/task.h>
#include <projectexplorer/toolchain.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -643,6 +645,21 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const
return g.matches("NMake Makefiles", extraGenerator)
|| g.matches("NMake Makefiles JOM", extraGenerator);
});
if (ProjectExplorerPlugin::projectExplorerSettings().useJom) {
it = std::find_if(known.constBegin(),
known.constEnd(),
[extraGenerator](const CMakeTool::Generator &g) {
return g.matches("NMake Makefiles JOM", extraGenerator);
});
}
if (it == known.constEnd()) {
it = std::find_if(known.constBegin(),
known.constEnd(),
[extraGenerator](const CMakeTool::Generator &g) {
return g.matches("NMake Makefiles", extraGenerator);
});
}
}
} else {
// Unix-oid OSes: