diff options
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
| -rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5d3e11a..d5b0c54 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2,26 +2,44 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalVisualStudio7Generator.h" +#include <algorithm> +#include <cassert> +#include <cstring> +#include <functional> +#include <sstream> +#include <utility> + #include <cm/memory> #include <cmext/algorithm> #include <windows.h> #include <cm3p/expat.h> -#include <ctype.h> // for isspace + +#include "cmsys/FStream.hxx" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" +#include "cmCustomCommandLines.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" #include "cmGlobalVisualStudio7Generator.h" +#include "cmGlobalVisualStudioGenerator.h" +#include "cmListFileCache.h" #include "cmMakefile.h" -#include "cmMessageType.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmSourceFile.h" +#include "cmSourceGroup.h" +#include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetDepend.h" +#include "cmValue.h" #include "cmXMLParser.h" #include "cmake.h" @@ -109,7 +127,6 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() const auto& tgts = this->GetGeneratorTargets(); for (auto& l : tgts) { if (l->GetType() == cmStateEnums::GLOBAL_TARGET) { - std::vector<std::string> no_depends; cmCustomCommandLines force_commands = cmMakeSingleCommandLine({ "cd", "." }); std::string no_main_dependency; @@ -119,9 +136,13 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() this->Makefile->GetOrCreateGeneratedSource(force)) { sf->SetProperty("SYMBOLIC", "1"); } + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetOutputs(force); + cc->SetCommandLines(force_commands); + cc->SetComment(" "); + cc->SetCMP0116Status(cmPolicies::NEW); if (cmSourceFile* file = this->AddCustomCommandToOutput( - force, no_depends, no_main_dependency, force_commands, " ", - nullptr, cmPolicies::NEW, true)) { + no_main_dependency, std::move(cc), true)) { l->AddSource(file->ResolveFullPath()); } } @@ -239,16 +260,19 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() std::string argB = cmStrCat("-B", this->GetBinaryDirectory()); std::string stampName = cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/generate.stamp"); - bool stdPipesUTF8 = true; cmCustomCommandLines commandLines = cmMakeSingleCommandLine({ cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-file", stampName }); std::string comment = cmStrCat("Building Custom Rule ", makefileIn); - const char* no_working_directory = nullptr; - this->AddCustomCommandToOutput(stampName, listFiles, makefileIn, - commandLines, comment.c_str(), - no_working_directory, cmPolicies::NEW, true, - false, false, false, "", "", stdPipesUTF8); + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetOutputs(stampName); + cc->SetDepends(listFiles); + cc->SetCommandLines(commandLines); + cc->SetComment(comment.c_str()); + cc->SetCMP0116Status(cmPolicies::NEW); + cc->SetEscapeOldStyle(false); + cc->SetStdPipesUTF8(true); + this->AddCustomCommandToOutput(makefileIn, std::move(cc), true); if (cmSourceFile* file = this->Makefile->GetSource(makefileIn)) { // Finalize the source file path now since we're adding this after // the generator validated all project-named sources. |
