summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r--cpp/src/slice2cpp/Main.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index b277edeadfa..5ae2b4b44ee 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -27,6 +27,7 @@ usage(const char* n)
"-UNAME Remove any definition for NAME.\n"
"-IDIR Put DIR in the include file search path.\n"
"--include-dir DIR Use DIR as the header include directory.\n"
+ "--output-dir DIR Create files in the directory DIR.\n"
"--dll-export SYMBOL Use SYMBOL for DLL exports.\n"
"-d, --debug Print debug messages.\n"
;
@@ -38,6 +39,7 @@ main(int argc, char* argv[])
string cpp("cpp");
vector<string> includePaths;
string include;
+ string output;
string dllExport;
bool debug = false;
@@ -107,6 +109,22 @@ main(int argc, char* argv[])
}
argc -= 2;
}
+ else if (strcmp(argv[idx], "--output-dir") == 0)
+ {
+ if (idx + 1 >= argc)
+ {
+ cerr << argv[0] << ": argument expected for`" << argv[idx] << "'" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ output = argv[idx + 1];
+ for (int i = idx ; i + 2 < argc ; ++i)
+ {
+ argv[i] = argv[i + 2];
+ }
+ argc -= 2;
+ }
else if (strcmp(argv[idx], "--dll-export") == 0)
{
if (idx + 1 >= argc)
@@ -196,7 +214,7 @@ main(int argc, char* argv[])
}
else
{
- Gen gen(argv[0], base, include, includePaths, dllExport);
+ Gen gen(argv[0], base, include, includePaths, dllExport, output);
if (!gen)
{
unit->destroy();