Commit 7b207a0b authored by Mathias Hasselmann's avatar Mathias Hasselmann Committed by Mathias Hasselmann

provide --save-temps option keep generated C source and header files when

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

svn path=/trunk/; revision=452
parent 0eb09317
......@@ -7,6 +7,14 @@
* vala/valasemanticanalyzer.vala: don't crash on missing type arguments,
fixes bug 464699
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
......
......@@ -45,6 +45,7 @@ class Vala.Compiler {
static string cc_command;
[NoArrayLength]
static string[] cc_options;
static bool save_temps;
private CodeContext context;
......@@ -65,6 +66,7 @@ class Vala.Compiler {
{ "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 }
};
......@@ -165,6 +167,7 @@ class Vala.Compiler {
context.debug = debug;
context.thread = thread;
context.optlevel = optlevel;
context.save_temps = save_temps;
/* default package */
if (!add_package (context, "glib-2.0")) {
......
......@@ -107,8 +107,10 @@ public class Vala.CCodeCompiler {
/* 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 ());
}
}
}
......
......@@ -85,6 +85,19 @@ public class Vala.CodeContext {
*/
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment