summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-09-12 15:28:11 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-09-12 15:28:11 +0200
commit54dd4ae0ddc92b3fbc02e104e9844b587e694a99 (patch)
tree80f49796e6aa67a7f2cfe3e3b5bd54050e40f7b1 /codemaker
parent6667caef24557d66177c1f7e9b72d2f609233d87 (diff)
Add cppumaker -nD "no dependent types are generated"
...just like javamaker. Change-Id: I7634a65a948ca7abdb7ad75d0aeca8becb38ab87
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/cppumaker/cppumaker.cxx20
-rw-r--r--codemaker/source/cppumaker/cppuoptions.cxx11
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx15
3 files changed, 33 insertions, 13 deletions
diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx
index 3f0c665807a8..2a698f415f03 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -78,13 +78,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
} else {
produce("", typeMgr, generated, options);
}
- // C++ header files generated for the following UNO types are included
- // in header files in cppu/inc/com/sun/star/uno (Any.hxx, Reference.hxx,
- // Type.h), so it seems best to always generate those C++ header files:
- produce(
- "com.sun.star.uno.RuntimeException", typeMgr, generated, options);
- produce("com.sun.star.uno.TypeClass", typeMgr, generated, options);
- produce("com.sun.star.uno.XInterface", typeMgr, generated, options);
+ if (!options.isValid("-nD")) {
+ // C++ header files generated for the following UNO types are
+ // included in header files in cppu/inc/com/sun/star/uno (Any.hxx,
+ // Reference.hxx, Type.h), so it seems best to always generate those
+ // C++ header files:
+ produce(
+ "com.sun.star.uno.RuntimeException", typeMgr, generated,
+ options);
+ produce(
+ "com.sun.star.uno.TypeClass", typeMgr, generated, options);
+ produce(
+ "com.sun.star.uno.XInterface", typeMgr, generated, options);
+ }
} catch (CannotDumpException & e) {
std::cerr << "ERROR: " << e.getMessage() << '\n';
return EXIT_FAILURE;
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index 3446134ab5d2..3e70b68c5131 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -94,6 +94,16 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
m_options["-O"] = OString(s);
break;
+ case 'n':
+ if (av[i][2] != 'D' || av[i][3] != '\0')
+ {
+ OString tmp("'-nD', please check");
+ tmp += " your input '" + OString(av[i]) + "'";
+ throw IllegalArgument(tmp);
+ }
+
+ m_options["-nD"] = OString("");
+ break;
case 'T':
if (av[i][2] == '\0')
{
@@ -321,6 +331,7 @@ OString CppuOptions::prepareHelp()
help += " '-L' should be the default for external components.\n";
help += " -C = UNO type functions are generated comprehensive that means all\n";
help += " necessary information is available for bridging the type in UNO.\n";
+ help += " -nD = no dependent types are generated.\n";
help += " -G = generate only target files which does not exists.\n";
help += " -Gc = generate only target files which content will be changed.\n";
help += " -X<file> = extra types which will not be taken into account for generation.\n\n";
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index b03e472c52e3..8f8cdf3c56b3 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -409,12 +409,15 @@ void CppuType::dumpFile(
void CppuType::dumpDependedTypes(
codemaker::GeneratedTypeSet & generated, CppuOptions const & options)
{
- codemaker::cppumaker::Dependencies::Map const & map
- = m_dependencies.getMap();
- for (codemaker::cppumaker::Dependencies::Map::const_iterator i(map.begin());
- i != map.end(); ++i)
- {
- produce(i->first, m_typeMgr, generated, options);
+ if (!options.isValid("-nD")) {
+ codemaker::cppumaker::Dependencies::Map const & map
+ = m_dependencies.getMap();
+ for (codemaker::cppumaker::Dependencies::Map::const_iterator i(
+ map.begin());
+ i != map.end(); ++i)
+ {
+ produce(i->first, m_typeMgr, generated, options);
+ }
}
}