summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-02-03 18:54:14 +0100
committerJose <jose@zeroc.com>2017-02-03 18:54:14 +0100
commit75de6845e9869fa5842f2c5da4706f578f77080e (patch)
tree503b41562128d862fe75ca591468f1e4960ae357
parentRework warning suppression to use global meta data (diff)
downloadice-75de6845e9869fa5842f2c5da4706f578f77080e.tar.bz2
ice-75de6845e9869fa5842f2c5da4706f578f77080e.tar.xz
ice-75de6845e9869fa5842f2c5da4706f578f77080e.zip
Fixed (ICE-7556) - header-ext and makefile dependencies
-rw-r--r--cpp/src/slice2cpp/Main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 7378da1b118..ebc2d08b8f3 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -266,6 +266,17 @@ compile(const vector<string>& argv)
UnitPtr u = Unit::createUnit(false, false, ice, underscore);
int parseStatus = u->parse(*i, cppHandle, debug);
+
+ string ext = headerExtension;
+ static const string headerExtPrefix = "cpp:header-ext:";
+ DefinitionContextPtr dc = u->findDefinitionContext(u->topLevelFile());
+ assert(dc);
+ string meta = dc->findMetaData(headerExtPrefix);
+ if(meta.size() > headerExtPrefix.size())
+ {
+ ext = meta.substr(headerExtPrefix.size());
+ }
+
u->destroy();
if(parseStatus == EXIT_FAILURE)
@@ -274,7 +285,7 @@ compile(const vector<string>& argv)
}
if(!icecpp->printMakefileDependencies(os, depend ? Preprocessor::CPlusPlus : Preprocessor::SliceXML,
- includePaths, "-D__SLICE2CPP__", sourceExtension, headerExtension))
+ includePaths, "-D__SLICE2CPP__", sourceExtension, ext))
{
return EXIT_FAILURE;
}