2007-08-08 Mathias Hasselmann <mathias.hasselmann@gmx.de>
+ * compiler/valacompiler.vala: provide --save-temps option
+ * gobject/valaccodecompiler.vala: keep generated C source and header
+ files when --save-temps, respectively --library options are used
+ * vala/valacodecontext.vala: add save_temps, save_csources
+ and save_cheaders property
+
+2007-08-08 Mathias Hasselmann <mathias.hasselmann@gmx.de>
+
* vapi/glib-2.0.vala: fix spelling of OptionFlags.FILENAME
2007-08-08 Jürg Billeter <j@bitron.ch>
static string cc_command;
[NoArrayLength]
static string[] cc_options;
+ static bool save_temps;
private CodeContext context;
{ "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable run-time checks", null },
{ "cc", 0, 0, OptionArg.STRING, out cc_command, "Use COMMAND as C compiler command", "COMMAND" },
{ "Xcc", 'X', 0, OptionArg.STRING_ARRAY, out cc_options, "Pass OPTION to the C compiler", "OPTION..." },
+ { "save-temps", 0, 0, OptionArg.NONE, out save_temps, "Keep temporary files", null },
{ "", 0, 0, OptionArg.FILENAME_ARRAY, out sources, null, "FILE..." },
{ null }
};
context.debug = debug;
context.thread = thread;
context.optlevel = optlevel;
+ context.save_temps = save_temps;
/* default package */
if (!add_package (context, "glib-2.0")) {
/* remove generated C source and header files */
foreach (SourceFile file in source_files) {
if (!file.pkg) {
- FileUtils.unlink (file.get_csource_filename ());
- FileUtils.unlink (file.get_cheader_filename ());
+ if (!context.save_csources)
+ FileUtils.unlink (file.get_csource_filename ());
+ if (!context.save_cheaders)
+ FileUtils.unlink (file.get_cheader_filename ());
}
}
}
*/
public Method module_init_method { get; set; }
+ /**
+ * Keep temporary files produced by the compiler.
+ */
+ public bool save_temps { get; set; }
+
+ public bool save_csources {
+ get { return save_temps; }
+ }
+
+ public bool save_cheaders {
+ get { return save_csources || null != library; }
+ }
+
private Gee.List<SourceFile> source_files = new ArrayList<SourceFile> ();
private Gee.List<string> c_source_files = new ArrayList<string> ();
private Namespace! _root = new Namespace (null);