summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-15 16:00:27 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-15 16:00:27 (GMT)
commitc6f1a11480f478b430fcb798ddeac972ec17ae6a (patch)
treea9e71d302bcb44201b223dee7528fcfb726662b9 /Source/cmLocalUnixMakefileGenerator3.cxx
parent7169980b59c16370fa5abec8159afc5cc84a96cd (diff)
downloadCMake-c6f1a11480f478b430fcb798ddeac972ec17ae6a.zip
CMake-c6f1a11480f478b430fcb798ddeac972ec17ae6a.tar.gz
CMake-c6f1a11480f478b430fcb798ddeac972ec17ae6a.tar.bz2
BUG: Added object language to list of object files in a local generator's directory. Fixed generation of preprocessing and assembly rules to be done only for C and C++ objects.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4c53470..525b791 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -288,7 +288,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
// now write out the object rules
// for each object file name
- for (std::map<cmStdString,std::vector<cmTarget *> >::iterator lo =
+ for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
this->LocalObjectFiles.begin();
lo != this->LocalObjectFiles.end(); ++lo)
{
@@ -297,8 +297,20 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
"target to build an object file",
lo->first.c_str(), lo->second);
+ // Check whether preprocessing and assembly rules make sense.
+ // They make sense only for C and C++ sources.
+ bool lang_is_c_or_cxx = false;
+ for(std::vector<LocalObjectEntry>::const_iterator ei =
+ lo->second.begin(); ei != lo->second.end(); ++ei)
+ {
+ if(ei->Language == "C" || ei->Language == "CXX")
+ {
+ lang_is_c_or_cxx = true;
+ }
+ }
+
// Add convenience rules for preprocessed and assembly files.
- if(do_preprocess_rules || do_assembly_rules)
+ if(lang_is_c_or_cxx && (do_preprocess_rules || do_assembly_rules))
{
std::string::size_type dot_pos = lo->first.rfind(".");
std::string base = lo->first.substr(0, dot_pos);
@@ -333,14 +345,15 @@ void
cmLocalUnixMakefileGenerator3
::WriteObjectConvenienceRule(std::ostream& ruleFileStream,
const char* comment, const char* output,
- std::vector<cmTarget*>& targets)
+ LocalObjectInfo const& targets)
{
// Recursively make the rule for each target using the object file.
std::vector<std::string> commands;
- for(std::vector<cmTarget*>::iterator t = targets.begin();
+ for(std::vector<LocalObjectEntry>::const_iterator t = targets.begin();
t != targets.end(); ++t)
{
- std::string tgtMakefileName = this->GetRelativeTargetDirectory(**t);
+ std::string tgtMakefileName =
+ this->GetRelativeTargetDirectory(*(t->Target));
std::string targetName = tgtMakefileName;
tgtMakefileName += "/build.make";
targetName += "/";