src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Palete / ValaSourceCompiler.vala
index 8d5a7c7..b245230 100644 (file)
@@ -227,7 +227,9 @@ namespace Palete {
                
                        context.experimental = false;
                        context.experimental_non_null = false;
-#if VALA_0_30
+#if VALA_0_32
+                       var ver=32;
+#elif VALA_0_30
                        var ver=30;
 #elif VALA_0_28
                        var ver=28;
@@ -262,15 +264,18 @@ namespace Palete {
                        context.gir_directories = {};
                        context.thread = true;
                        valac += " --thread ";
-                        
+                       
+                       // we should parse the compilegroup to find out the flags..
+                       context.debug = true;
+                       valac += " -g ";
                        
                        this.report = new ValaSourceReport(this.original_filepath, this.filepath);
                        context.report = this.report;
                        
-                       //valac += " -b  /tmp ";
-                       context.basedir = Posix.realpath (".");
+                       valac += " -b  " + GLib.Environment.get_home_dir() + " ";
+                       context.basedir = GLib.Environment.get_home_dir(); //Posix.realpath (".");
                
-                       context.directory = context.basedir;
+                       context.directory = null; //??? causes target to end up in the right place at present..
                
 
                        // add default packages:
@@ -334,6 +339,8 @@ namespace Palete {
                                        
                                }
                        }
+                       
+                       // print("%s\n", valac); -
                        // default.. packages..
                        context.add_external_package ("glib-2.0"); 
                        context.add_external_package ("gobject-2.0");
@@ -341,6 +348,12 @@ namespace Palete {
                        
                var dcg = pr.compilegroups.get("_default_");
                for (var i = 0; i < dcg.packages.size; i++) {
+               
+                       var pkg = dcg.packages.get(i);
+                       // do not add libvala versions except the one that matches the one we are compiled against..
+                       if (Regex.match_simple("^libvala", pkg) && pkg != ("libvala-0." + ver.to_string())) {
+                               continue;
+                       }
                                valac += " --pkg " + dcg.packages.get(i);
                                if (!this.has_vapi(context.vapi_directories, dcg.packages.get(i))) {
                                        GLib.debug("Skip vapi '%s' - does not exist", dcg.packages.get(i));
@@ -354,8 +367,8 @@ namespace Palete {
                        
                        // add the modules...
                        
-                       context.output = this.output == "" ? "/tmp/testbuild" : this.output;
-                       valac += " -o " +context.output;
+                       context.output = this.output == "" ? "/tmp/testrun" : this.output;
+                       valac += " -o " + context.output;
                        GLib.debug("%s", valac);
                        
                        context.target_glib_major = 2;
@@ -408,9 +421,10 @@ namespace Palete {
                        var cc_command = Environment.get_variable ("CC");
                        
                        
-                       string [] cc_options = { "-lm" };
+                       string [] cc_options = { "-lm", "-pg" };
+                       valac += " -X -lm -X -pg";
                        
-#if VALA_0_28
+#if VALA_0_28 || VALA_0_30 || VALA_0_32
                        var pkg_config_command = Environment.get_variable ("PKG_CONFIG");
                        ccompiler.compile (context, cc_command, cc_options, pkg_config_command);
 #else