summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-12-09 13:04:22 -0800
committerJose <jose@zeroc.com>2016-12-09 13:04:22 -0800
commita27d97552e6c310dfd25406b7fa538b3508cb90b (patch)
tree6209d51904d239b8b16faf66182743f47b15ebaf /cpp
parentFix for dependency parse updates in previous commit (diff)
downloadice-a27d97552e6c310dfd25406b7fa538b3508cb90b.tar.bz2
ice-a27d97552e6c310dfd25406b7fa538b3508cb90b.tar.xz
ice-a27d97552e6c310dfd25406b7fa538b3508cb90b.zip
Skip lines that not end with .ice when processing dependencies
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp101
1 files changed, 52 insertions, 49 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 88a881b29d1..7feffe9d1c4 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -408,72 +408,75 @@ Slice::Preprocessor::printMakefileDependencies(ostream& out, Language lang, cons
{
end += 1;
string file = IceUtilInternal::trim(unprocessed.substr(pos, end - pos));
- if(IceUtilInternal::isAbsolutePath(file))
+ if(file.rfind(".ice") == file.size() - 4)
{
- if(file == _fileName)
+ if(IceUtilInternal::isAbsolutePath(file))
{
- file = _shortFileName;
- }
- else
- {
- //
- // Transform back full paths generated by mcpp to paths relative to the specified
- // include paths.
- //
- string newFile = file;
- for(vector<string>::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p)
+ if(file == _fileName)
{
- if(file.compare(0, p->length(), *p) == 0)
+ file = _shortFileName;
+ }
+ else
+ {
+ //
+ // Transform back full paths generated by mcpp to paths relative to the specified
+ // include paths.
+ //
+ string newFile = file;
+ for(vector<string>::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p)
{
- string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length());
- if(IceUtilInternal::isAbsolutePath(newFile) || s.size() < newFile.size())
+ if(file.compare(0, p->length(), *p) == 0)
{
- newFile = s;
+ string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length());
+ if(IceUtilInternal::isAbsolutePath(newFile) || s.size() < newFile.size())
+ {
+ newFile = s;
+ }
}
}
+ file = newFile;
}
- file = newFile;
}
- }
- if(lang == SliceXML)
- {
- if(result.size() == 0)
+ if(lang == SliceXML)
{
- result = " <source name=\"" + file + "\">";
- }
- else
- {
- result += "\n <dependsOn name=\"" + file + "\"/>";
+ if(result.size() == 0)
+ {
+ result = " <source name=\"" + file + "\">";
+ }
+ else
+ {
+ result += "\n <dependsOn name=\"" + file + "\"/>";
+ }
}
- }
- else if(lang == JavaScriptJSON)
- {
- if(sourceFile.empty())
+ else if(lang == JavaScriptJSON)
{
- sourceFile = file;
+ if(sourceFile.empty())
+ {
+ sourceFile = file;
+ }
+ else
+ {
+ dependencies.push_back(file);
+ }
}
else
{
- dependencies.push_back(file);
- }
- }
- else
- {
- //
- // Escape spaces in the file name.
- //
- string::size_type space = 0;
- while((space = file.find(" ", space)) != string::npos)
- {
- file.replace(space, 1, "\\ ");
- space += 2;
- }
+ //
+ // Escape spaces in the file name.
+ //
+ string::size_type space = 0;
+ while((space = file.find(" ", space)) != string::npos)
+ {
+ file.replace(space, 1, "\\ ");
+ space += 2;
+ }
- //
- // Add to result
- //
- result += " \\\n " + file;
+ //
+ // Add to result
+ //
+ result += " \\\n " + file;
+ }
}
pos = end;
}