diff options
author | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-13 17:44:37 (GMT) |
---|---|---|
committer | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-16 18:45:41 (GMT) |
commit | 7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d (patch) | |
tree | fed5733ab7c5219c0f5377a2b3fcb2674ac27b55 /Source/cmGlobalVisualStudioGenerator.cxx | |
parent | 1ac4e0ef1b29affc9e4f2cd86c4fc8c2252f2ab2 (diff) | |
download | CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.zip CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.gz CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.bz2 |
cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and
applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 6e0b804..a0ce740 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -13,6 +13,7 @@ #include "cmAlgorithms.h" #include "cmCallVisualStudioMacro.h" #include "cmCustomCommand.h" +#include "cmCustomCommandLines.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmLocalVisualStudioGenerator.h" @@ -900,17 +901,11 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand( std::string obj_dir = gt->ObjectDirectory; std::string cmakeCommand = cmSystemTools::GetCMakeCommand(); cmSystemTools::ConvertToWindowsExtendedPath(cmakeCommand); - cmCustomCommandLine cmdl; - cmdl.push_back(cmakeCommand); - cmdl.push_back("-E"); - cmdl.push_back("__create_def"); - cmdl.push_back(mdi->DefFile); std::string obj_dir_expanded = obj_dir; cmSystemTools::ReplaceString(obj_dir_expanded, this->GetCMakeCFGIntDir(), configName.c_str()); cmSystemTools::MakeDirectory(obj_dir_expanded); std::string const objs_file = obj_dir_expanded + "/objects.txt"; - cmdl.push_back(objs_file); cmGeneratedFileStream fout(objs_file.c_str()); if (!fout) { cmSystemTools::Error("could not open " + objs_file); @@ -948,8 +943,8 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand( fout << i->GetFullPath() << "\n"; } - cmCustomCommandLines commandLines; - commandLines.push_back(cmdl); + cmCustomCommandLines commandLines = cmMakeSingleCommandLine( + { cmakeCommand, "-E", "__create_def", mdi->DefFile, objs_file }); cmCustomCommand command(gt->Target->GetMakefile(), outputs, empty, empty, commandLines, "Auto build dll exports", "."); commands.push_back(command); |