diff options
author | Brad King <brad.king@kitware.com> | 2011-05-18 13:44:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-05-18 13:44:28 (GMT) |
commit | c45c60b24ff52d9435ceab0de027fbadac130a1f (patch) | |
tree | e4bc48a68cd02c19d03b99cf061c542d20f64322 /Source/cmSystemTools.cxx | |
parent | 7c5be5114c1c1adb26cfe7e8556187bf9bd8bd0a (diff) | |
download | CMake-c45c60b24ff52d9435ceab0de027fbadac130a1f.zip CMake-c45c60b24ff52d9435ceab0de027fbadac130a1f.tar.gz CMake-c45c60b24ff52d9435ceab0de027fbadac130a1f.tar.bz2 |
run_compile_commands: Avoid extra stl vector conversion
The Sun compiler does not provide the proper vector constructor to
initialize it from an iterator pair of a non-matching type. Extend the
ParseUnixCommandLine API to provide a vector of the proper type so no
conversion is needed.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7bc89a4..df6469f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -440,6 +440,13 @@ public: args.push_back(*arg); } } + void Store(std::vector<cmStdString>& args) const + { + for(char** arg = this->ArgV; arg && *arg; ++arg) + { + args.push_back(*arg); + } + } }; //---------------------------------------------------------------------------- @@ -451,6 +458,15 @@ void cmSystemTools::ParseUnixCommandLine(const char* command, argv.Store(args); } +//---------------------------------------------------------------------------- +void cmSystemTools::ParseUnixCommandLine(const char* command, + std::vector<cmStdString>& args) +{ + // Invoke the underlying parser. + cmSystemToolsArgV argv = cmsysSystem_Parse_CommandForUnix(command, 0); + argv.Store(args); +} + std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg, int shell_flags) { |