[buildj] fix linking of local libraries



commit f3a79f1625c83ae8cc609b526d0b6c8b33a4918a
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Sun Mar 28 18:37:27 2010 +0100

    fix linking of local libraries

 buildj.py         |    8 ++++++--
 project.js        |    1 +
 vala_library.vala |    4 ++--
 vala_program.vala |    1 +
 wscript           |    5 ++---
 5 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/buildj.py b/buildj.py
index 1278a40..0109b89 100644
--- a/buildj.py
+++ b/buildj.py
@@ -71,7 +71,7 @@ class ProjectFile:
 				else:
 					path = subdir
 				target_data['path'] = path
-				self._project['targets'] = target_data
+				self._project['targets'][target_name] = target_data
 				self._targets.append(ProjectTarget(target_name, target_data))
 
 	def __repr__ (self):
@@ -237,7 +237,8 @@ class CcTarget (ProjectTarget):
 
 		uses = self.get_uses ()
 		if uses:
-			args["uselib_local"] = uses
+			# waf vala support will modify the list if we pass one
+			args["uselib_local"] = " ".join (uses)
 
 		if self.get_type () == "sharedlib" and self.get_version ():
 			args["vnum"] = self.get_version ()
@@ -250,6 +251,9 @@ class CcTarget (ProjectTarget):
 		if defines:
 			args["defines"] = defines
 
+		if self.get_type () in ("sharedlib", "staticlib"):
+			args["export_incdirs"] = '.'
+
 		return args
 
 class ValaTarget (CcTarget):
diff --git a/project.js b/project.js
index 1379a20..ecbdbf7 100644
--- a/project.js
+++ b/project.js
@@ -42,6 +42,7 @@
 			"type":     "program",
 			"tool":     "vala",
 			"input":    ["vala_program.vala"],
+			"uses":     ["my_vala_shared_lib"],
 			"packages": ["gtk+-2.0"]
 		},
 		"my_vala_shared_lib":
diff --git a/vala_library.vala b/vala_library.vala
index 18b89b8..7e6bf4f 100644
--- a/vala_library.vala
+++ b/vala_library.vala
@@ -1,5 +1,5 @@
 namespace BuilDj {
-	class Test : Object {
-		public Test ();
+	public class Test : Object {
+		public Test () {}
 	}
 }
diff --git a/vala_program.vala b/vala_program.vala
index 95387a5..fce36a1 100644
--- a/vala_program.vala
+++ b/vala_program.vala
@@ -3,5 +3,6 @@ using Gtk;
 public static int main (string[] args)
 {
 	Gtk.init (ref args);
+	new BuilDj.Test ();
 	return 0;	
 }
diff --git a/wscript b/wscript
index 1b3eaf8..e23572a 100644
--- a/wscript
+++ b/wscript
@@ -85,7 +85,7 @@ def configure (conf):
 	#We check all the tools' required packages
 	for package in project.get_packages_required ():
 		conf.check_cfg (**package.get_check_pkg_args ())
-		
+
 	#FIXME: This should be done upstream
 	if "vala" in project.get_tools():
 		if not conf.env.HAVE_GLIB_2_0:
@@ -98,8 +98,7 @@ def build(bld):
 	for target in project.get_targets ():
 		args = target.get_build_arguments ()
 		args['path'] = bld.srcnode.find_dir(target.get_path().split('/'))
-
-		bld (**args)
+		bld.new_task_gen (**args)
 
 		install_files = target.get_install_files ()
 		if install_files:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]