2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-24 18:25:03 +01:00

Issue 1632

This commit is contained in:
Thomas Nagy 2015-10-16 23:10:32 +02:00
parent b5584470f9
commit 85e403516c

View File

@ -45,10 +45,14 @@ def init_vala_task(self):
""" """
self.profile = getattr(self, 'profile', 'gobject') self.profile = getattr(self, 'profile', 'gobject')
self.packages = packages = Utils.to_list(getattr(self, 'packages', []))
self.use = Utils.to_list(getattr(self, 'use', []))
if packages and not self.use:
self.use = packages[:] # copy
if self.profile == 'gobject': if self.profile == 'gobject':
self.uselib = Utils.to_list(getattr(self, 'uselib', [])) if not 'GOBJECT' in self.use:
if not 'GOBJECT' in self.uselib: self.use.append('GOBJECT')
self.uselib.append('GOBJECT')
def addflags(flags): def addflags(flags):
self.env.append_value('VALAFLAGS', flags) self.env.append_value('VALAFLAGS', flags)
@ -74,8 +78,8 @@ def init_vala_task(self):
if hasattr(self, 'thread'): if hasattr(self, 'thread'):
if self.profile == 'gobject': if self.profile == 'gobject':
if not 'GTHREAD' in self.uselib: if not 'GTHREAD' in self.use:
self.uselib.append('GTHREAD') self.use.append('GTHREAD')
else: else:
#Vala doesn't have threading support for dova nor posix #Vala doesn't have threading support for dova nor posix
Logs.warn("Profile %s means no threading support" % self.profile) Logs.warn("Profile %s means no threading support" % self.profile)
@ -119,7 +123,6 @@ def init_vala_task(self):
return api_version return api_version
self.includes = Utils.to_list(getattr(self, 'includes', [])) self.includes = Utils.to_list(getattr(self, 'includes', []))
self.uselib = self.to_list(getattr(self, 'uselib', []))
valatask.install_path = getattr(self, 'install_path', '') valatask.install_path = getattr(self, 'install_path', '')
valatask.vapi_path = getattr(self, 'vapi_path', '${DATAROOTDIR}/vala/vapi') valatask.vapi_path = getattr(self, 'vapi_path', '${DATAROOTDIR}/vala/vapi')
@ -127,7 +130,6 @@ def init_vala_task(self):
valatask.header_path = getattr(self, 'header_path', '${INCLUDEDIR}/%s-%s' % (valatask.pkg_name, _get_api_version())) valatask.header_path = getattr(self, 'header_path', '${INCLUDEDIR}/%s-%s' % (valatask.pkg_name, _get_api_version()))
valatask.install_binding = getattr(self, 'install_binding', True) valatask.install_binding = getattr(self, 'install_binding', True)
self.packages = packages = Utils.to_list(getattr(self, 'packages', []))
self.vapi_dirs = vapi_dirs = Utils.to_list(getattr(self, 'vapi_dirs', [])) self.vapi_dirs = vapi_dirs = Utils.to_list(getattr(self, 'vapi_dirs', []))
#includes = [] #includes = []
@ -215,7 +217,7 @@ def vala_file(self, node):
bld.program( bld.program(
packages = 'gtk+-2.0', packages = 'gtk+-2.0',
target = 'vala-gtk-example', target = 'vala-gtk-example',
uselib = 'GTK GLIB', use = 'GTK GLIB',
source = 'vala-gtk-example.vala foo.vala', source = 'vala-gtk-example.vala foo.vala',
vala_defines = ['DEBUG'] # adds --define=<xyz> values to the command-line vala_defines = ['DEBUG'] # adds --define=<xyz> values to the command-line