Avoids const_cast in configure_command by using mutable

This commit is contained in:
Benjamin Piwowarski 2014-03-21 18:38:09 +01:00 committed by Richard Heck
parent d53cf7f575
commit 73405549cb

View File

@ -154,9 +154,8 @@ Package::Package(string const & command_line_arg0,
std::string const & Package::configure_command() const std::string const & Package::configure_command() const
{ {
if (configure_command_.empty()) { if (configure_command_.empty()) {
std::string &command = const_cast<std::string&>(configure_command_);
FileName const configure_script(addName(system_support().absFileName(), "configure.py")); FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
command = os::python() + ' ' + configure_command_ = os::python() + ' ' +
quoteName(configure_script.toFilesystemEncoding()) + quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix() + " --binary-dir=" + with_version_suffix() + " --binary-dir=" +
quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding()); quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());