|
|
@@ -3,7 +3,6 @@
|
|
|
#include "cmIncludeCommand.h"
|
|
|
|
|
|
#include <map>
|
|
|
-#include <sstream>
|
|
|
#include <utility>
|
|
|
|
|
|
#include "cmExecutionStatus.h"
|
|
|
@@ -117,36 +116,15 @@ bool cmIncludeCommand(std::vector<std::string> const& args,
|
|
|
|
|
|
cmGlobalGenerator* gg = status.GetMakefile().GetGlobalGenerator();
|
|
|
if (gg->IsExportedTargetsFile(fname_abs)) {
|
|
|
- const char* modal = nullptr;
|
|
|
- std::ostringstream e;
|
|
|
- MessageType messageType = MessageType::AUTHOR_WARNING;
|
|
|
-
|
|
|
- switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0024)) {
|
|
|
- case cmPolicies::WARN:
|
|
|
- e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0024) << "\n";
|
|
|
- modal = "should";
|
|
|
- CM_FALLTHROUGH;
|
|
|
- case cmPolicies::OLD:
|
|
|
- break;
|
|
|
- case cmPolicies::NEW:
|
|
|
- modal = "may";
|
|
|
- messageType = MessageType::FATAL_ERROR;
|
|
|
- }
|
|
|
- if (modal) {
|
|
|
- e << "The file\n " << fname_abs
|
|
|
- << "\nwas generated by the export() "
|
|
|
- "command. It "
|
|
|
- << modal
|
|
|
- << " not be used as the argument to the "
|
|
|
- "include() command. Use ALIAS targets instead to refer to targets "
|
|
|
- "by alternative names.\n";
|
|
|
- status.GetMakefile().IssueMessage(messageType, e.str());
|
|
|
- if (messageType == MessageType::FATAL_ERROR) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- gg->CreateGenerationObjects();
|
|
|
- gg->GenerateImportFile(fname_abs);
|
|
|
+ status.GetMakefile().IssueMessage(
|
|
|
+ MessageType::FATAL_ERROR,
|
|
|
+ cmStrCat(
|
|
|
+ "The file\n ", fname_abs,
|
|
|
+ "\nwas generated by the export() "
|
|
|
+ "command. It may not be used as the argument to the "
|
|
|
+ "include() command. Use ALIAS targets instead to refer to targets "
|
|
|
+ "by alternative names.\n"));
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
std::string listFile = cmSystemTools::CollapseFullPath(
|