mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
cmBuildOptions: Split build arguments into separate object.
This commit is contained in:
committed by
Brad King
parent
6a10103493
commit
193b8fca52
@@ -155,6 +155,7 @@ set(SRCS
|
||||
cmBinUtilsWindowsPELinker.h
|
||||
cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
|
||||
cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h
|
||||
cmBuildOptions.h
|
||||
cmCacheManager.cxx
|
||||
cmCacheManager.h
|
||||
cmCLocaleEnvironmentScope.h
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "cmsys/Process.h"
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmCTest.h"
|
||||
#include "cmCTestTestHandler.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
@@ -263,10 +264,12 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
|
||||
if (!config) {
|
||||
config = "Debug";
|
||||
}
|
||||
|
||||
cmBuildOptions buildOptions(!this->BuildNoClean, false);
|
||||
int retVal = cm.GetGlobalGenerator()->Build(
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, this->SourceDir, this->BinaryDir,
|
||||
this->BuildProject, { tar }, output, this->BuildMakeProgram, config,
|
||||
!this->BuildNoClean, false, false, remainingTime);
|
||||
buildOptions, false, remainingTime);
|
||||
out << output;
|
||||
// if the build failed then return
|
||||
if (retVal) {
|
||||
|
||||
21
Source/cmBuildOptions.h
Normal file
21
Source/cmBuildOptions.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
struct cmBuildOptions
|
||||
{
|
||||
public:
|
||||
cmBuildOptions() noexcept = default;
|
||||
explicit cmBuildOptions(bool clean, bool fast) noexcept
|
||||
: Clean(clean)
|
||||
, Fast(fast)
|
||||
{
|
||||
}
|
||||
explicit cmBuildOptions(const cmBuildOptions&) noexcept = default;
|
||||
cmBuildOptions& operator=(const cmBuildOptions&) noexcept = default;
|
||||
|
||||
bool Clean = false;
|
||||
bool Fast = false;
|
||||
};
|
||||
@@ -71,12 +71,13 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalBorlandMakefileGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int /*jobs*/, bool verbose,
|
||||
const std::string& config, int /*jobs*/, bool verbose,
|
||||
const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeProgram, projectName, projectDir, targetNames, config, fast,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, makeOptions);
|
||||
makeProgram, projectName, projectDir, targetNames, config,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, buildOptions, makeOptions);
|
||||
}
|
||||
|
||||
void cmGlobalBorlandMakefileGenerator::PrintBuildCommandAdvice(
|
||||
|
||||
@@ -59,7 +59,8 @@ protected:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -1994,16 +1994,19 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir,
|
||||
}
|
||||
std::string config =
|
||||
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
||||
cmBuildOptions defaultBuildOptions(false, fast);
|
||||
|
||||
return this->Build(jobs, srcdir, bindir, projectName, newTarget, output, "",
|
||||
config, false, fast, false, this->TryCompileTimeout);
|
||||
config, defaultBuildOptions, false,
|
||||
this->TryCompileTimeout);
|
||||
}
|
||||
|
||||
std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalGenerator::GenerateBuildCommand(
|
||||
const std::string& /*unused*/, const std::string& /*unused*/,
|
||||
const std::string& /*unused*/, std::vector<std::string> const& /*unused*/,
|
||||
const std::string& /*unused*/, bool /*unused*/, int /*unused*/,
|
||||
bool /*unused*/, std::vector<std::string> const& /*unused*/)
|
||||
const std::string& /*unused*/, int /*unused*/, bool /*unused*/,
|
||||
const cmBuildOptions& /*unused*/, std::vector<std::string> const& /*unused*/)
|
||||
{
|
||||
GeneratedMakeCommand makeCommand;
|
||||
makeCommand.Add("cmGlobalGenerator::GenerateBuildCommand not implemented");
|
||||
@@ -2021,7 +2024,7 @@ int cmGlobalGenerator::Build(
|
||||
int jobs, const std::string& /*unused*/, const std::string& bindir,
|
||||
const std::string& projectName, const std::vector<std::string>& targets,
|
||||
std::string& output, const std::string& makeCommandCSTR,
|
||||
const std::string& config, bool clean, bool fast, bool verbose,
|
||||
const std::string& config, const cmBuildOptions& buildOptions, bool verbose,
|
||||
cmDuration timeout, cmSystemTools::OutputOption outputflag,
|
||||
std::vector<std::string> const& nativeOptions)
|
||||
{
|
||||
@@ -2053,9 +2056,9 @@ int cmGlobalGenerator::Build(
|
||||
std::string outputBuffer;
|
||||
std::string* outputPtr = &outputBuffer;
|
||||
|
||||
std::vector<GeneratedMakeCommand> makeCommand =
|
||||
this->GenerateBuildCommand(makeCommandCSTR, projectName, bindir, targets,
|
||||
realConfig, fast, jobs, verbose, nativeOptions);
|
||||
std::vector<GeneratedMakeCommand> makeCommand = this->GenerateBuildCommand(
|
||||
makeCommandCSTR, projectName, bindir, targets, realConfig, jobs, verbose,
|
||||
buildOptions, nativeOptions);
|
||||
|
||||
// Workaround to convince some commands to produce output.
|
||||
if (outputflag == cmSystemTools::OUTPUT_PASSTHROUGH &&
|
||||
@@ -2064,10 +2067,11 @@ int cmGlobalGenerator::Build(
|
||||
}
|
||||
|
||||
// should we do a clean first?
|
||||
if (clean) {
|
||||
if (buildOptions.Clean) {
|
||||
std::vector<GeneratedMakeCommand> cleanCommand =
|
||||
this->GenerateBuildCommand(makeCommandCSTR, projectName, bindir,
|
||||
{ "clean" }, realConfig, fast, jobs, verbose);
|
||||
{ "clean" }, realConfig, jobs, verbose,
|
||||
buildOptions);
|
||||
output += "\nRun Clean Command:";
|
||||
output += cleanCommand.front().Printable();
|
||||
output += "\n";
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "cm_codecvt.hxx"
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmCustomCommandLines.h"
|
||||
#include "cmDuration.h"
|
||||
#include "cmExportSet.h"
|
||||
@@ -229,8 +230,8 @@ public:
|
||||
int jobs, const std::string& srcdir, const std::string& bindir,
|
||||
const std::string& projectName,
|
||||
std::vector<std::string> const& targetNames, std::string& output,
|
||||
const std::string& makeProgram, const std::string& config, bool clean,
|
||||
bool fast, bool verbose, cmDuration timeout,
|
||||
const std::string& makeProgram, const std::string& config,
|
||||
const cmBuildOptions& buildOptions, bool verbose, cmDuration timeout,
|
||||
cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_NONE,
|
||||
std::vector<std::string> const& nativeOptions =
|
||||
std::vector<std::string>());
|
||||
@@ -248,7 +249,8 @@ public:
|
||||
virtual std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions = std::vector<std::string>());
|
||||
|
||||
virtual void PrintBuildCommandAdvice(std::ostream& os, int jobs) const;
|
||||
|
||||
@@ -510,7 +510,8 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalGhsMultiGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& /*config*/, bool /*fast*/, int jobs, bool /*verbose*/,
|
||||
const std::string& /*config*/, int jobs, bool /*verbose*/,
|
||||
const cmBuildOptions& /*buildOptions*/,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
GeneratedMakeCommand makeCommand = {};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmGlobalGeneratorFactory.h"
|
||||
#include "cmTargetDepend.h"
|
||||
@@ -87,7 +88,8 @@ protected:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalJOMMakefileGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
std::vector<std::string> jomMakeOptions;
|
||||
@@ -81,6 +82,6 @@ cmGlobalJOMMakefileGenerator::GenerateBuildCommand(
|
||||
}
|
||||
|
||||
return cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeProgram, projectName, projectDir, targetNames, config, fast, jobs,
|
||||
verbose, jomMakeOptions);
|
||||
makeProgram, projectName, projectDir, targetNames, config, jobs, verbose,
|
||||
buildOptions, jomMakeOptions);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ protected:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -106,7 +106,8 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalNMakeMakefileGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int /*jobs*/, bool verbose,
|
||||
const std::string& config, int /*jobs*/, bool verbose,
|
||||
const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
std::vector<std::string> nmakeMakeOptions;
|
||||
@@ -117,8 +118,8 @@ cmGlobalNMakeMakefileGenerator::GenerateBuildCommand(
|
||||
cm::append(nmakeMakeOptions, makeOptions);
|
||||
|
||||
return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeProgram, projectName, projectDir, targetNames, config, fast,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, nmakeMakeOptions);
|
||||
makeProgram, projectName, projectDir, targetNames, config,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, buildOptions, nmakeMakeOptions);
|
||||
}
|
||||
|
||||
void cmGlobalNMakeMakefileGenerator::PrintBuildCommandAdvice(std::ostream& os,
|
||||
|
||||
@@ -58,7 +58,8 @@ protected:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ cmGlobalNinjaGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& /*projectName*/,
|
||||
const std::string& /*projectDir*/,
|
||||
std::vector<std::string> const& targetNames, const std::string& config,
|
||||
bool /*fast*/, int jobs, bool verbose,
|
||||
int jobs, bool verbose, const cmBuildOptions& /*buildOptions*/,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
GeneratedMakeCommand makeCommand;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "cm_codecvt.hxx"
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmGlobalCommonGenerator.h"
|
||||
#include "cmGlobalGeneratorFactory.h"
|
||||
@@ -199,7 +200,8 @@ public:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& /*projectName*/,
|
||||
const std::string& /*projectDir*/,
|
||||
std::vector<std::string> const& targetNames, const std::string& /*config*/,
|
||||
bool fast, int jobs, bool verbose,
|
||||
int jobs, bool verbose, const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
GeneratedMakeCommand makeCommand;
|
||||
@@ -548,7 +548,7 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeCommand.Add(makeOptions.begin(), makeOptions.end());
|
||||
for (auto tname : targetNames) {
|
||||
if (!tname.empty()) {
|
||||
if (fast) {
|
||||
if (buildOptions.Fast) {
|
||||
tname += "/fast";
|
||||
}
|
||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
#include "cmGlobalCommonGenerator.h"
|
||||
#include "cmGlobalGeneratorFactory.h"
|
||||
@@ -163,7 +164,8 @@ public:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -1099,7 +1099,8 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
std::vector<GeneratedMakeCommand> makeCommands;
|
||||
@@ -1145,8 +1146,8 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
if (useDevEnv) {
|
||||
// Use devenv to build solutions containing Intel Fortran projects.
|
||||
return cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||
makeProgram, projectName, projectDir, targetNames, config, fast, jobs,
|
||||
verbose, makeOptions);
|
||||
makeProgram, projectName, projectDir, targetNames, config, jobs, verbose,
|
||||
buildOptions, makeOptions);
|
||||
}
|
||||
|
||||
std::vector<std::string> realTargetNames = targetNames;
|
||||
@@ -1178,8 +1179,9 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
||||
cmSystemTools::ConvertToUnixSlashes(targetProject);
|
||||
}
|
||||
}
|
||||
makeCommand.Add(std::move(targetProject));
|
||||
makeCommand.Add(targetProject);
|
||||
}
|
||||
|
||||
std::string configArg = "/p:Configuration=";
|
||||
if (!config.empty()) {
|
||||
configArg += config;
|
||||
|
||||
@@ -43,7 +43,8 @@ public:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& /*projectDir*/,
|
||||
std::vector<std::string> const& targetNames, const std::string& config,
|
||||
bool /*fast*/, int /*jobs*/, bool /*verbose*/,
|
||||
int /*jobs*/, bool /*verbose*/, const cmBuildOptions& /*buildOptions*/,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
// Select the caller- or user-preferred make program, else devenv.
|
||||
|
||||
@@ -69,7 +69,8 @@ public:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -65,12 +65,13 @@ std::vector<cmGlobalGenerator::GeneratedMakeCommand>
|
||||
cmGlobalWatcomWMakeGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int /*jobs*/, bool verbose,
|
||||
const std::string& config, int /*jobs*/, bool verbose,
|
||||
const cmBuildOptions& buildOptions,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeProgram, projectName, projectDir, targetNames, config, fast,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, makeOptions);
|
||||
makeProgram, projectName, projectDir, targetNames, config,
|
||||
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, buildOptions, makeOptions);
|
||||
}
|
||||
|
||||
void cmGlobalWatcomWMakeGenerator::PrintBuildCommandAdvice(std::ostream& os,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmGlobalGeneratorFactory.h"
|
||||
#include "cmGlobalUnixMakefileGenerator3.h"
|
||||
|
||||
@@ -57,7 +58,8 @@ protected:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& /*projectDir*/,
|
||||
std::vector<std::string> const& targetNames, const std::string& config,
|
||||
bool /*fast*/, int jobs, bool /*verbose*/,
|
||||
int jobs, bool /*verbose*/, const cmBuildOptions& /*buildOptions*/,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
GeneratedMakeCommand makeCommand;
|
||||
|
||||
@@ -80,7 +80,8 @@ public:
|
||||
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
||||
const std::string& makeProgram, const std::string& projectName,
|
||||
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
||||
const std::string& config, bool fast, int jobs, bool verbose,
|
||||
const std::string& config, int jobs, bool verbose,
|
||||
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
||||
std::vector<std::string> const& makeOptions =
|
||||
std::vector<std::string>()) override;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "cm_sys_stat.h"
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmCMakePath.h"
|
||||
#include "cmCMakePresetsGraph.h"
|
||||
#include "cmCommandLineArgument.h"
|
||||
@@ -3219,8 +3220,8 @@ std::vector<std::string> cmake::GetDebugConfigs()
|
||||
|
||||
int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
||||
std::string config, std::vector<std::string> nativeOptions,
|
||||
bool clean, bool verbose, const std::string& presetName,
|
||||
bool listPresets)
|
||||
cmBuildOptions& buildOptions, bool verbose,
|
||||
const std::string& presetName, bool listPresets)
|
||||
{
|
||||
this->SetHomeDirectory("");
|
||||
this->SetHomeOutputDirectory("");
|
||||
@@ -3326,8 +3327,8 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
||||
config = expandedPreset->Configuration;
|
||||
}
|
||||
|
||||
if (!clean && expandedPreset->CleanFirst) {
|
||||
clean = *expandedPreset->CleanFirst;
|
||||
if (!buildOptions.Clean && expandedPreset->CleanFirst) {
|
||||
buildOptions.Clean = *expandedPreset->CleanFirst;
|
||||
}
|
||||
|
||||
if (!verbose && expandedPreset->Verbose) {
|
||||
@@ -3466,7 +3467,7 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
||||
|
||||
this->GlobalGenerator->PrintBuildCommandAdvice(std::cerr, jobs);
|
||||
return this->GlobalGenerator->Build(
|
||||
jobs, "", dir, projName, targets, output, "", config, clean, false,
|
||||
jobs, "", dir, projName, targets, output, "", config, buildOptions,
|
||||
verbose, cmDuration::zero(), cmSystemTools::OUTPUT_PASSTHROUGH,
|
||||
nativeOptions);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ class cmMakefileProfilingData;
|
||||
#endif
|
||||
class cmMessenger;
|
||||
class cmVariableWatch;
|
||||
struct cmBuildOptions;
|
||||
struct cmDocumentationEntry;
|
||||
|
||||
/** \brief Represents a cmake invocation.
|
||||
@@ -587,8 +588,8 @@ public:
|
||||
//! run the --build option
|
||||
int Build(int jobs, std::string dir, std::vector<std::string> targets,
|
||||
std::string config, std::vector<std::string> nativeOptions,
|
||||
bool clean, bool verbose, const std::string& presetName,
|
||||
bool listPresets);
|
||||
cmBuildOptions& buildOptions, bool verbose,
|
||||
const std::string& presetName, bool listPresets);
|
||||
|
||||
//! run the --open option
|
||||
bool Open(const std::string& dir, bool dryRun);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
#include <cm3p/uv.h>
|
||||
|
||||
#include "cmBuildOptions.h"
|
||||
#include "cmCommandLineArgument.h"
|
||||
#include "cmConsoleBuf.h"
|
||||
#include "cmDocumentationEntry.h" // IWYU pragma: keep
|
||||
@@ -657,7 +659,7 @@ int do_build(int ac, char const* const* av)
|
||||
});
|
||||
|
||||
return cm.Build(jobs, std::move(dir), std::move(targets), std::move(config),
|
||||
std::move(nativeOptions), cleanFirst, verbose, presetName,
|
||||
std::move(nativeOptions), buildOptions, verbose, presetName,
|
||||
listPresets);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user