Fix linking with --as-needed and on Windows, patch by Yaakov Selkowitz,
authorJürg Billeter <j@bitron.ch>
Wed, 30 Jul 2008 21:31:49 +0000 (21:31 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 30 Jul 2008 21:31:49 +0000 (21:31 +0000)
2008-07-30  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodecompiler.vala:

Fix linking with --as-needed and on Windows,
patch by Yaakov Selkowitz, fixes bug 545427

svn path=/trunk/; revision=1728

ChangeLog
gobject/valaccodecompiler.vala

index 6546581..2d47988 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-07-30  Jürg Billeter  <j@bitron.ch>
 
+       * gobject/valaccodecompiler.vala:
+
+       Fix linking with --as-needed and on Windows,
+       patch by Yaakov Selkowitz, fixes bug 545427
+
+2008-07-30  Jürg Billeter  <j@bitron.ch>
+
        * vapi/glib-2.0.vapi:
 
        Add GObject.ref_count binding, fixes bug 532584
index 47d6725..9be754c 100644 (file)
@@ -93,10 +93,6 @@ public class Vala.CCodeCompiler : Object {
                        }
                        cmdline += " -o " + Shell.quote (output);
                }
-               cmdline += " " + pkgflags;
-               foreach (string cc_option in cc_options) {
-                       cmdline += " " + Shell.quote (cc_option);
-               }
 
                /* make sure include files can be found if -d is used */
                if (context.directory != null && context.directory != "") {
@@ -115,6 +111,13 @@ public class Vala.CCodeCompiler : Object {
                        cmdline += " " + Shell.quote (file);
                }
 
+               // add libraries after source files to fix linking
+               // with --as-needed and on Windows
+               cmdline += " " + pkgflags;
+               foreach (string cc_option in cc_options) {
+                       cmdline += " " + Shell.quote (cc_option);
+               }
+
                try {
                        Process.spawn_command_line_sync (cmdline, null, null, out exit_status);
                        if (exit_status != 0) {