[NoArrayLength]
static string[] cc_options;
static bool save_temps;
- [NoArrayLength]
- static string[] defines;
static bool quiet_mode;
private CodeContext context;
{ "output", 'o', 0, OptionArg.FILENAME, ref output, "Place output in file FILE", "FILE" },
{ "debug", 'g', 0, OptionArg.NONE, ref debug, "Produce debug information", null },
{ "thread", 0, 0, OptionArg.NONE, ref thread, "Enable multithreading support", null },
- { "define", 'D', 0, OptionArg.STRING_ARRAY, ref defines, "Define SYMBOL", "SYMBOL..." },
{ "disable-assert", 0, 0, OptionArg.NONE, ref disable_assert, "Disable assertions", null },
{ "disable-checking", 0, 0, OptionArg.NONE, ref disable_checking, "Disable run-time checks", null },
{ "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null },
Report.error (null, "This version of valac only supports GLib 2");
}
- if (defines != null) {
- foreach (string define in defines) {
- context.add_define (define);
- }
- }
-
context.codegen = new CCodeGenerator ();
/* default packages */
private Gee.List<string> packages = new ArrayList<string> (str_equal);
- private Gee.List<string> defines = new ArrayList<string> (str_equal);
-
/**
* The root namespace of the symbol tree.
*
file.mark = 2;
}
- public void add_define (string define) {
- defines.add (define);
- }
-
- public bool ignore_node (CodeNode node) {
- var attr = node.get_attribute ("Conditional");
- if (attr == null) {
- return false;
- } else {
- var condition = attr.get_string ("condition");
- if (condition == null) {
- return false;
- } else {
- return !defines.contains (condition);
- }
- }
- }
-
public string? get_package_path (string pkg, [CCode (array_length_pos = 1.9)] string[] vapi_directories) {
string basename = "%s.vapi".printf (pkg);
string filename = null;