summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-24 14:16:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-10-24 14:16:40 (GMT)
commitb899c0a92f6833c4996276d86d9e0fb3d42df77c (patch)
tree4a21fd3a3ac03ec9d5ae9a9acd9d7f7e0ee1af23 /Source/cmCommand.cxx
parent3d5ec790eea47a91c6f70d172c42839db02b8467 (diff)
parent569509f4bfbf44c67e237a01f957fdfe52223cfa (diff)
downloadCMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.zip
CMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.tar.gz
CMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.tar.bz2
Merge topic 'separate-compilation'
569509f4 Fix newly discovered clang-tidy issues 6c9b3b5c cmCommand: implement functions in cxx file 8483dab8 bootstrap: Sort source files lexicographically 4fb70919 Create all commands from a single function 608afd4f Separate compilation for commands included in cmBootstrapCommands2 64f9c282 Separate compilation for commands included in cmBootstrapCommands1 f69e768d Separate compilation for commands included in cmCommands
Diffstat (limited to 'Source/cmCommand.cxx')
-rw-r--r--Source/cmCommand.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx
new file mode 100644
index 0000000..3c839de
--- /dev/null
+++ b/Source/cmCommand.cxx
@@ -0,0 +1,48 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmCommand.h"
+
+bool cmCommand::InvokeInitialPass(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus& status)
+{
+ std::vector<std::string> expandedArguments;
+ if (!this->Makefile->ExpandArguments(args, expandedArguments)) {
+ // There was an error expanding arguments. It was already
+ // reported, so we can skip this command without error.
+ return true;
+ }
+ return this->InitialPass(expandedArguments, status);
+}
+
+const char* cmCommand::GetError()
+{
+ if (this->Error.empty()) {
+ this->Error = this->GetName();
+ this->Error += " unknown error.";
+ }
+ return this->Error.c_str();
+}
+
+void cmCommand::SetError(const std::string& e)
+{
+ this->Error = this->GetName();
+ this->Error += " ";
+ this->Error += e;
+}
+
+bool cmCommand::Disallowed(cmPolicies::PolicyID pol, const char* e)
+{
+ switch (this->Makefile->GetPolicyStatus(pol)) {
+ case cmPolicies::WARN:
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(pol));
+ case cmPolicies::OLD:
+ return false;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
+ break;
+ }
+ return true;
+}