summaryrefslogtreecommitdiff
path: root/Source/cmTargetCompileOptionsCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTargetCompileOptionsCommand.cxx')
-rw-r--r--Source/cmTargetCompileOptionsCommand.cxx71
1 files changed, 30 insertions, 41 deletions
diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx
index 254acc73d..1b4056d76 100644
--- a/Source/cmTargetCompileOptionsCommand.cxx
+++ b/Source/cmTargetCompileOptionsCommand.cxx
@@ -1,62 +1,51 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2013 Stephen Kelly <steveire@gmail.com>
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmTargetCompileOptionsCommand.h"
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
+#include <sstream>
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#include "cmTargetCompileOptionsCommand.h"
+#include "cmAlgorithms.h"
+#include "cmListFileCache.h"
+#include "cmMakefile.h"
+#include "cmTarget.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
-bool cmTargetCompileOptionsCommand
-::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+bool cmTargetCompileOptionsCommand::InitialPass(
+ std::vector<std::string> const& args, cmExecutionStatus&)
{
return this->HandleArguments(args, "COMPILE_OPTIONS", PROCESS_BEFORE);
}
-void cmTargetCompileOptionsCommand
-::HandleImportedTarget(const std::string &tgt)
+void cmTargetCompileOptionsCommand::HandleImportedTarget(
+ const std::string& tgt)
{
- cmOStringStream e;
- e << "Cannot specify compile options for imported target \""
- << tgt << "\".";
+ std::ostringstream e;
+ e << "Cannot specify compile options for imported target \"" << tgt << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
-void cmTargetCompileOptionsCommand
-::HandleMissingTarget(const std::string &name)
+void cmTargetCompileOptionsCommand::HandleMissingTarget(
+ const std::string& name)
{
- cmOStringStream e;
- e << "Cannot specify compile options for target \"" << name << "\" "
+ std::ostringstream e;
+ e << "Cannot specify compile options for target \"" << name
+ << "\" "
"which is not built by this project.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
-//----------------------------------------------------------------------------
-std::string cmTargetCompileOptionsCommand
-::Join(const std::vector<std::string> &content)
+std::string cmTargetCompileOptionsCommand::Join(
+ const std::vector<std::string>& content)
{
- std::string defs;
- std::string sep;
- for(std::vector<std::string>::const_iterator it = content.begin();
- it != content.end(); ++it)
- {
- defs += sep + *it;
- sep = ";";
- }
- return defs;
+ return cmJoin(content, ";");
}
-//----------------------------------------------------------------------------
-void cmTargetCompileOptionsCommand
-::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
- bool, bool)
+bool cmTargetCompileOptionsCommand::HandleDirectContent(
+ cmTarget* tgt, const std::vector<std::string>& content, bool, bool)
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmValueWithOrigin entry(this->Join(content), lfbt);
- tgt->InsertCompileOption(entry);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ tgt->InsertCompileOption(this->Join(content), lfbt);
+ return true;
}