summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCTest.cxx15
-rw-r--r--Source/cmCommands.cxx8
-rw-r--r--Source/cmComputeLinkDepends.cxx20
-rw-r--r--Source/cmComputeLinkDepends.h1
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmState.cxx18
-rw-r--r--Source/cmState.h3
8 files changed, 47 insertions, 23 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b7232f3..6e684a3 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2257,11 +2257,6 @@ bool cmCTest::ProgressOutputSupportedByConsole()
bool cmCTest::ColoredOutputSupportedByConsole()
{
-#if defined(_WIN32)
- // Not supported on Windows
- return false;
-#else
- // On UNIX we need a non-dumb tty.
std::string clicolor_force;
if (cmSystemTools::GetEnv("CLICOLOR_FORCE", clicolor_force) &&
!clicolor_force.empty() && clicolor_force != "0") {
@@ -2271,6 +2266,11 @@ bool cmCTest::ColoredOutputSupportedByConsole()
if (cmSystemTools::GetEnv("CLICOLOR", clicolor) && clicolor == "0") {
return false;
}
+#if defined(_WIN32)
+ // Not supported on Windows
+ return false;
+#else
+ // On UNIX we need a non-dumb tty.
return ConsoleIsNotDumb();
#endif
}
@@ -3736,12 +3736,7 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
std::string cmCTest::GetColorCode(Color color) const
{
if (this->Impl->OutputColorCode) {
-#if defined(_WIN32)
- // Not supported on Windows
- static_cast<void>(color);
-#else
return "\033[0;" + std::to_string(static_cast<int>(color)) + "m";
-#endif
}
return "";
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 2ee4f47..91f7691 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -219,9 +219,11 @@ void GetScriptingCommands(cmState* state)
state->AddDisallowedCommand(
"use_mangled_mesa", cmUseMangledMesaCommand, cmPolicies::CMP0030,
"The use_mangled_mesa command should not be called; see CMP0030.");
- state->AddDisallowedCommand(
- "exec_program", cmExecProgramCommand, cmPolicies::CMP0153,
- "The exec_program command should not be called; see CMP0153.");
+ state->AddDisallowedCommand("exec_program", cmExecProgramCommand,
+ cmPolicies::CMP0153,
+ "The exec_program command should not be called; "
+ "see CMP0153. Use execute_process() instead.",
+ "Use execute_process() instead.");
#endif
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 7394d86..596572b 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -27,6 +27,7 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmRange.h"
+#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
@@ -320,6 +321,9 @@ cmComputeLinkDepends::Compute()
// Follow the link dependencies of the target to be linked.
this->AddDirectLinkEntries();
+ // Add dependencies on targets named by $<TARGET_OBJECTS:...> sources.
+ this->AddTargetObjectEntries();
+
// Complete the breadth-first search of dependencies.
while (!this->BFSQueue.empty()) {
// Get the next entry.
@@ -513,6 +517,7 @@ void cmComputeLinkDepends::AddLinkObject(cmLinkItem const& item)
LinkEntry& entry = this->EntryList[index];
entry.Item = BT<std::string>(item.AsStr(), item.Backtrace);
entry.Kind = LinkEntry::Object;
+ entry.Target = item.Target;
// Record explicitly linked object files separately.
this->ObjectEntries.emplace_back(index);
@@ -701,6 +706,21 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
}
}
+void cmComputeLinkDepends::AddTargetObjectEntries()
+{
+ std::vector<cmSourceFile const*> externalObjects;
+ this->Target->GetExternalObjects(externalObjects, this->Config);
+ for (auto const* externalObject : externalObjects) {
+ std::string const& objLib = externalObject->GetObjectLibrary();
+ if (objLib.empty()) {
+ continue;
+ }
+ cmLinkItem const& objItem =
+ this->Target->ResolveLinkItem(BT<std::string>(objLib));
+ this->AddLinkObject(objItem);
+ }
+}
+
template <typename T>
void cmComputeLinkDepends::AddLinkEntries(size_t depender_index,
std::vector<T> const& libs)
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 22c4e2a..63c289c 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -100,6 +100,7 @@ private:
void AddLinkObject(cmLinkItem const& item);
void AddVarLinkEntries(size_t depender_index, const char* value);
void AddDirectLinkEntries();
+ void AddTargetObjectEntries();
template <typename T>
void AddLinkEntries(size_t depender_index, std::vector<T> const& libs);
void AddLinkObjects(std::vector<cmLinkItem> const& objs);
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 4cf3042..bd7ebed 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1252,7 +1252,7 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry)
this->AddFullItem(entry);
this->AddLibraryRuntimeInfo(item.Value);
}
- } else {
+ } else if (entry.Kind != cmComputeLinkDepends::LinkEntry::Object) {
// This is a library or option specified by the user.
this->AddUserItem(entry, true);
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 05b6690..dabb078 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1257,8 +1257,6 @@ cmNinjaBuild GetScanBuildStatement(const std::string& ruleName,
{
cmNinjaBuild scanBuild(ruleName);
- scanBuild.RspFile = "$out.rsp";
-
if (compilePP) {
// Move compilation dependencies to the scan/preprocessing build statement.
std::swap(scanBuild.ExplicitDeps, objBuild.ExplicitDeps);
@@ -1299,6 +1297,7 @@ cmNinjaBuild GetScanBuildStatement(const std::string& ruleName,
// Tell dependency scanner where to store dyndep intermediate results.
std::string ddiFileName = cmStrCat(objectFileName, ".ddi");
scanBuild.Variables["DYNDEP_INTERMEDIATE_FILE"] = ddiFileName;
+ scanBuild.RspFile = cmStrCat(ddiFileName, ".rsp");
// Outputs of the scan/preprocessor build statement.
if (compilePP) {
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d41e8e5..8ae2166 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -447,17 +447,23 @@ void cmState::AddFlowControlCommand(std::string const& name,
void cmState::AddDisallowedCommand(std::string const& name,
BuiltinCommand command,
cmPolicies::PolicyID policy,
- const char* message)
+ const char* message,
+ const char* additionalWarning)
{
this->AddBuiltinCommand(
name,
- [command, policy, message](const std::vector<cmListFileArgument>& args,
- cmExecutionStatus& status) -> bool {
+ [command, policy, message,
+ additionalWarning](const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus& status) -> bool {
cmMakefile& mf = status.GetMakefile();
switch (mf.GetPolicyStatus(policy)) {
- case cmPolicies::WARN:
- mf.IssueMessage(MessageType::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(policy));
+ case cmPolicies::WARN: {
+ std::string warning = cmPolicies::GetPolicyWarning(policy);
+ if (additionalWarning) {
+ warning = cmStrCat(warning, '\n', additionalWarning);
+ }
+ mf.IssueMessage(MessageType::AUTHOR_WARNING, warning);
+ }
CM_FALLTHROUGH;
case cmPolicies::OLD:
break;
diff --git a/Source/cmState.h b/Source/cmState.h
index b79f3e6..702b06f 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -183,7 +183,8 @@ public:
void AddFlowControlCommand(std::string const& name, Command command);
void AddFlowControlCommand(std::string const& name, BuiltinCommand command);
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
- cmPolicies::PolicyID policy, const char* message);
+ cmPolicies::PolicyID policy, const char* message,
+ const char* additionalWarning = nullptr);
void AddUnexpectedCommand(std::string const& name, const char* error);
void AddUnexpectedFlowControlCommand(std::string const& name,
const char* error);