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 = 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); + } } }