diff options
author | Jose <jose@zeroc.com> | 2016-01-14 14:16:11 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-14 14:16:11 +0100 |
commit | 807949c33d791a9c53a036754d1016fb22e5eb0f (patch) | |
tree | 55ef5ef9229a3ce26b6f8159ca6073ed8895ca6b /cpp/src/slice2cpp/Main.cpp | |
parent | Merge remote-tracking branch 'origin/3.6' (diff) | |
download | ice-807949c33d791a9c53a036754d1016fb22e5eb0f.tar.bz2 ice-807949c33d791a9c53a036754d1016fb22e5eb0f.tar.xz ice-807949c33d791a9c53a036754d1016fb22e5eb0f.zip |
Add slice2cpp --impl-c++98/--impl-c++11 options
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Main.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index c0da52fdaec..013f3dbce16 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -73,7 +73,8 @@ usage(const char* n) "--include-dir DIR Use DIR as the header include directory in source files.\n" "--output-dir DIR Create files in the directory DIR.\n" "--dll-export SYMBOL Use SYMBOL for DLL exports.\n" - "--impl Generate sample implementations.\n" + "--impl-c++98 Generate sample implementations for C++98 mapping.\n" + "--impl-c++11 Generate sample implementations for C++11 mapping.\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" @@ -102,7 +103,8 @@ compile(int argc, char* argv[]) opts.addOpt("", "include-dir", IceUtilInternal::Options::NeedArg); opts.addOpt("", "output-dir", IceUtilInternal::Options::NeedArg); opts.addOpt("", "dll-export", IceUtilInternal::Options::NeedArg); - opts.addOpt("", "impl"); + opts.addOpt("", "impl-c++98"); + opts.addOpt("", "impl-c++11"); opts.addOpt("", "depend"); opts.addOpt("", "depend-xml"); opts.addOpt("", "depend-file", IceUtilInternal::Options::NeedArg, ""); @@ -182,7 +184,9 @@ compile(int argc, char* argv[]) string dllExport = opts.optArg("dll-export"); - bool impl = opts.isSet("impl"); + bool implCpp98 = opts.isSet("impl-c++98"); + + bool implCpp11 = opts.isSet("impl-c++11"); bool depend = opts.isSet("depend"); @@ -219,6 +223,16 @@ compile(int argc, char* argv[]) } return EXIT_FAILURE; } + + if(implCpp98 && implCpp11) + { + getErrorStream() << argv[0] << ": error: cannot specify both --impl-c++98 and --impl-c++11" << endl; + if(!validate) + { + usage(argv[0]); + } + return EXIT_FAILURE; + } if(validate) { @@ -326,7 +340,7 @@ compile(int argc, char* argv[]) try { Gen gen(icecpp->getBaseName(), headerExtension, sourceExtension, extraHeaders, include, - includePaths, dllExport, output, impl, checksum, stream, ice); + includePaths, dllExport, output, implCpp98, implCpp11, checksum, stream, ice); gen.generate(u); } catch(const Slice::FileException& ex) |