diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2018-10-30 20:13:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-25 13:20:02 (GMT) |
commit | 1a45266cb544d73a7d7e46d6129ead1faf71fa85 (patch) | |
tree | 3deb468824f493530a91f0da882dafa069921c94 /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 378473f9f184000cb768c1b99e6242e054787f34 (diff) | |
download | CMake-1a45266cb544d73a7d7e46d6129ead1faf71fa85.zip CMake-1a45266cb544d73a7d7e46d6129ead1faf71fa85.tar.gz CMake-1a45266cb544d73a7d7e46d6129ead1faf71fa85.tar.bz2 |
cmGlobalGenerator: Add a class that represent the build command
This refactors a std::vector<std::string> into a class so that
we can extend the features to represent things such as multiple
chained commands in the future.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index cae46e1..997d33f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -191,7 +191,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType( return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942"; } void cmGlobalVisualStudio7Generator::GenerateBuildCommand( - std::vector<std::string>& makeCommand, const std::string& makeProgram, + GeneratedMakeCommand& makeCommand, const std::string& makeProgram, const std::string& projectName, const std::string& /*projectDir*/, const std::string& targetName, const std::string& config, bool /*fast*/, int /*jobs*/, bool /*verbose*/, std::vector<std::string> const& makeOptions) @@ -209,35 +209,25 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand( makeProgramSelected = this->GetDevEnvCommand(); } - makeCommand.push_back(makeProgramSelected); + // Workaround to convince VCExpress.exe to produce output. + makeCommand.RequiresOutputForward = + (makeProgramLower.find("vcexpress") != std::string::npos); - makeCommand.push_back(std::string(projectName) + ".sln"); + makeCommand.add(makeProgramSelected); + + makeCommand.add(std::string(projectName) + ".sln"); std::string realTarget = targetName; bool clean = false; if (realTarget == "clean") { clean = true; realTarget = "ALL_BUILD"; } - if (clean) { - makeCommand.push_back("/clean"); - } else { - makeCommand.push_back("/build"); - } - - if (!config.empty()) { - makeCommand.push_back(config); - } else { - makeCommand.push_back("Debug"); - } - makeCommand.push_back("/project"); - if (!realTarget.empty()) { - makeCommand.push_back(realTarget); - } else { - makeCommand.push_back("ALL_BUILD"); - } - makeCommand.insert(makeCommand.end(), makeOptions.begin(), - makeOptions.end()); + makeCommand.add((clean ? "/clean" : "/build")); + makeCommand.add((config.empty() ? "Debug" : config)); + makeCommand.add("/project"); + makeCommand.add((realTarget.empty() ? "ALL_BUILD" : realTarget)); + makeCommand.add(makeOptions.begin(), makeOptions.end()); } ///! Create a local generator appropriate to this Global Generator |