summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-04-13 14:58:28 +0200
committerJose <jose@zeroc.com>2015-04-13 14:58:28 +0200
commit8cff2a828400acb3769b7b05452ac267725086eb (patch)
tree3735ea75f8890fcec71909b0ce4cc616bd14d30a /cpp/src/slice2objc
parentICE-6445 Remove .NET CF support (diff)
downloadice-8cff2a828400acb3769b7b05452ac267725086eb.tar.bz2
ice-8cff2a828400acb3769b7b05452ac267725086eb.tar.xz
ice-8cff2a828400acb3769b7b05452ac267725086eb.zip
Add --depend-file/--depend-xml optinos to all Slice compilers
Diffstat (limited to 'cpp/src/slice2objc')
-rw-r--r--cpp/src/slice2objc/Main.cpp22
-rw-r--r--cpp/src/slice2objc/Makefile2
2 files changed, 20 insertions, 4 deletions
diff --git a/cpp/src/slice2objc/Main.cpp b/cpp/src/slice2objc/Main.cpp
index fe9189514a1..92da5f2a617 100644
--- a/cpp/src/slice2objc/Main.cpp
+++ b/cpp/src/slice2objc/Main.cpp
@@ -70,6 +70,7 @@ usage(const char* n)
"--dll-export SYMBOL Use SYMBOL for DLL exports.\n"
"--depend Generate Makefile dependencies.\n"
"--depend-xml Generate dependencies in XML format.\n"
+ "--depend-file FILE Write dependencies to FILE instead of standard output.\n"
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
"--underscore Permit underscores in Slice identifiers.\n"
@@ -92,6 +93,7 @@ main(int argc, char* argv[])
opts.addOpt("", "dll-export", IceUtilInternal::Options::NeedArg);
opts.addOpt("", "depend");
opts.addOpt("", "depend-xml");
+ opts.addOpt("", "depend-file", IceUtilInternal::Options::NeedArg, "");
opts.addOpt("d", "debug");
opts.addOpt("", "ice");
opts.addOpt("", "underscore");
@@ -151,6 +153,7 @@ main(int argc, char* argv[])
bool depend = opts.isSet("depend");
bool dependxml = opts.isSet("depend-xml");
+ string dependFile = opts.optArg("depend-file");
bool debug = opts.isSet("debug");
@@ -165,11 +168,19 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
+ if(depend && dependxml)
+ {
+ getErrorStream() << argv[0] << ": error: cannot specify both --depend and --dependxml" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
int status = EXIT_SUCCESS;
+ DependOutputUtil out(dependFile);
if(dependxml)
{
- cout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<dependencies>" << endl;
+ out.os() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<dependencies>" << endl;
}
IceUtil::CtrlCHandler ctrlCHandler;
@@ -184,6 +195,7 @@ main(int argc, char* argv[])
if(cppHandle == 0)
{
+ out.cleanup();
return EXIT_FAILURE;
}
@@ -193,17 +205,20 @@ main(int argc, char* argv[])
if(parseStatus == EXIT_FAILURE)
{
+ out.cleanup();
return EXIT_FAILURE;
}
- if(!icecpp->printMakefileDependencies(depend ? Preprocessor::ObjC : Preprocessor::JavaXML,
+ if(!icecpp->printMakefileDependencies(out.os(), depend ? Preprocessor::ObjC : Preprocessor::SliceXML,
includePaths, "-D__SLICE2OBJC__"))
{
+ out.cleanup();
return EXIT_FAILURE;
}
if(!icecpp->close())
{
+ out.cleanup();
return EXIT_FAILURE;
}
}
@@ -279,6 +294,7 @@ main(int argc, char* argv[])
if(interrupted)
{
+ out.cleanup();
FileTracker::instance()->cleanup();
return EXIT_FAILURE;
}
@@ -287,7 +303,7 @@ main(int argc, char* argv[])
if(dependxml)
{
- cout << "</dependencies>\n";
+ out.os() << "</dependencies>\n";
}
return status;
diff --git a/cpp/src/slice2objc/Makefile b/cpp/src/slice2objc/Makefile
index 244fd0a5c82..e95af7fd610 100644
--- a/cpp/src/slice2objc/Makefile
+++ b/cpp/src/slice2objc/Makefile
@@ -20,7 +20,7 @@ RPATH_DIR = $(LOADER_PATH)/../$(libsubdir)
include $(top_srcdir)/config/Make.rules
-CPPFLAGS := -I. $(CPPFLAGS)
+CPPFLAGS := -I. -I.. $(CPPFLAGS)
$(NAME): $(OBJS)
rm -f $@