summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-10 16:16:08 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-10 16:58:36 (GMT)
commit97fae68b81d7dbb5dda9fe21f860863bcc0c7183 (patch)
treee42aa63347e642769757e9e8901a757fcbb06506 /Source/cmGlobalUnixMakefileGenerator3.cxx
parent330af68ed4eca375160b31aefd71bd6ea11b586f (diff)
downloadCMake-97fae68b81d7dbb5dda9fe21f860863bcc0c7183.zip
CMake-97fae68b81d7dbb5dda9fe21f860863bcc0c7183.tar.gz
CMake-97fae68b81d7dbb5dda9fe21f860863bcc0c7183.tar.bz2
Remove INTERFACE build targets.
Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY targets., 2013-08-21) extended the makefile generator to create build targets for INTERFACE_LIBRARY targets. No other generators were extended with this feature. This conflicts with the feature of whitelisting of target properties read from INTERFACE_LIBRARY targets. The INTERFACE_* properties of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY generator expressions for reading properties from the 'head target'. The 'head target' would be the INTERFACE_LIBRARY itself when creating the build rules for it, which means that non-whitelisted properties would be read.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx92
1 files changed, 37 insertions, 55 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6333873..52465dc 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -480,7 +480,6 @@ cmGlobalUnixMakefileGenerator3
(l->second->GetType() == cmTarget::SHARED_LIBRARY) ||
(l->second->GetType() == cmTarget::MODULE_LIBRARY) ||
(l->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
- (l->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
(l->second->GetType() == cmTarget::UTILITY))
{
if(l->second->Target->IsImported())
@@ -658,7 +657,6 @@ cmGlobalUnixMakefileGenerator3
(t->second->GetType() == cmTarget::SHARED_LIBRARY) ||
(t->second->GetType() == cmTarget::MODULE_LIBRARY) ||
(t->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
- (t->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
(t->second->GetType() == cmTarget::UTILITY)))
{
// Add a rule to build the target by name.
@@ -680,10 +678,6 @@ cmGlobalUnixMakefileGenerator3
t->second->GetName(), depends, commands,
true);
- if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
- {
- continue;
- }
// Add a fast rule to build the target
std::string localName =
lg->GetRelativeTargetDirectory(*t->second->Target);
@@ -757,7 +751,6 @@ cmGlobalUnixMakefileGenerator3
|| (t->second->GetType() == cmTarget::SHARED_LIBRARY)
|| (t->second->GetType() == cmTarget::MODULE_LIBRARY)
|| (t->second->GetType() == cmTarget::OBJECT_LIBRARY)
- || (t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
|| (t->second->GetType() == cmTarget::UTILITY)))
{
std::string makefileName;
@@ -774,64 +767,53 @@ cmGlobalUnixMakefileGenerator3
<< localName << "\n\n";
commands.clear();
+ makeTargetName = localName;
+ makeTargetName += "/depend";
+ commands.push_back(lg->GetRecursiveMakeCall
+ (makefileName.c_str(),makeTargetName.c_str()));
- if(t->second->GetType() != cmTarget::INTERFACE_LIBRARY)
+ // add requires if we need it for this generator
+ if (needRequiresStep)
{
makeTargetName = localName;
- makeTargetName += "/depend";
+ makeTargetName += "/requires";
commands.push_back(lg->GetRecursiveMakeCall
(makefileName.c_str(),makeTargetName.c_str()));
+ }
+ makeTargetName = localName;
+ makeTargetName += "/build";
+ commands.push_back(lg->GetRecursiveMakeCall
+ (makefileName.c_str(),makeTargetName.c_str()));
- // add requires if we need it for this generator
- if (needRequiresStep)
- {
- makeTargetName = localName;
- makeTargetName += "/requires";
- commands.push_back(lg->GetRecursiveMakeCall
- (makefileName.c_str(),makeTargetName.c_str()));
- }
- makeTargetName = localName;
- makeTargetName += "/build";
- commands.push_back(lg->GetRecursiveMakeCall
- (makefileName.c_str(),makeTargetName.c_str()));
-
- // Write the rule.
- localName += "/all";
- depends.clear();
+ // Write the rule.
+ localName += "/all";
+ depends.clear();
- std::string progressDir =
- lg->GetMakefile()->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
+ std::string progressDir =
+ lg->GetMakefile()->GetHomeOutputDirectory();
+ progressDir += cmake::GetCMakeFilesDirectory();
+ {
+ cmOStringStream progCmd;
+ progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
+ // all target counts
+ progCmd << lg->Convert(progressDir.c_str(),
+ cmLocalGenerator::FULL,
+ cmLocalGenerator::SHELL);
+ progCmd << " ";
+ std::vector<unsigned long>& progFiles =
+ this->ProgressMap[t->second->Target].Marks;
+ for (std::vector<unsigned long>::iterator i = progFiles.begin();
+ i != progFiles.end(); ++i)
{
- cmOStringStream progCmd;
- progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
- // all target counts
- progCmd << lg->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- progCmd << " ";
- std::vector<unsigned long>& progFiles =
- this->ProgressMap[t->second->Target].Marks;
- for (std::vector<unsigned long>::iterator i = progFiles.begin();
- i != progFiles.end(); ++i)
- {
- progCmd << " " << *i;
- }
- commands.push_back(progCmd.str());
+ progCmd << " " << *i;
}
- progressDir = "Built target ";
- progressDir += t->second->GetName();
- lg->AppendEcho(commands,progressDir.c_str());
- }
- else
- {
- depends.clear();
+ commands.push_back(progCmd.str());
}
+ progressDir = "Built target ";
+ progressDir += t->second->GetName();
+ lg->AppendEcho(commands,progressDir.c_str());
+
this->AppendGlobalTargetDepends(depends,*t->second->Target);
- if(depends.empty() && this->EmptyRuleHackDepends != "")
- {
- depends.push_back(this->EmptyRuleHackDepends);
- }
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
localName.c_str(), depends, commands, true);
@@ -847,7 +829,7 @@ cmGlobalUnixMakefileGenerator3
// Write the rule.
commands.clear();
- std::string progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
+ progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
{