diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-04-02 13:37:16 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-04-03 07:58:29 +0200 |
commit | 55ce2510f3a3058a567a03aa726bf2ecf2319276 (patch) | |
tree | 694dbec50d712e903f497d4d66f69b362ae350f1 /vapigen | |
parent | 3da030f6f1c8d1be3577e36c72ff6a62ae93e12e (diff) | |
download | vala-55ce2510f3a3058a567a03aa726bf2ecf2319276.tar.gz |
vapigen: Add --nostdpkg option like in valac
Diffstat (limited to 'vapigen')
-rw-r--r-- | vapigen/valavapigen.vala | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala index 81b627e92..287ec7aea 100644 --- a/vapigen/valavapigen.vala +++ b/vapigen/valavapigen.vala @@ -38,12 +38,15 @@ class Vala.VAPIGen : Object { static string library; [CCode (array_length = false, array_null_terminated = true)] static string[] packages; + static bool nostdpkg; + CodeContext context; const OptionEntry[] options = { { "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, ref vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..." }, { "girdir", 0, 0, OptionArg.FILENAME_ARRAY, ref gir_directories, "Look for GIR bindings in DIRECTORY", "DIRECTORY..." }, { "metadatadir", 0, 0, OptionArg.FILENAME_ARRAY, ref metadata_directories, "Look for GIR .metadata files in DIRECTORY", "DIRECTORY..." }, + { "nostdpkg", 0, 0, OptionArg.NONE, ref nostdpkg, "Do not include standard packages", null }, { "pkg", 0, 0, OptionArg.STRING_ARRAY, ref packages, "Include binding for PACKAGE", "PACKAGE..." }, { "library", 0, 0, OptionArg.STRING, ref library, "Library name", "NAME" }, { "directory", 'd', 0, OptionArg.FILENAME, ref directory, "Output directory", "DIRECTORY" }, @@ -77,10 +80,13 @@ class Vala.VAPIGen : Object { context.report.enable_warnings = !disable_warnings; context.report.set_verbose_errors (!quiet_mode); CodeContext.push (context); - - /* default package */ - context.add_external_package ("glib-2.0"); - context.add_external_package ("gobject-2.0"); + context.nostdpkg = nostdpkg; + + if (!nostdpkg) { + /* default package */ + context.add_external_package ("glib-2.0"); + context.add_external_package ("gobject-2.0"); + } if (context.report.get_errors () > 0) { return quit (); |