Can use external dependencies in Vala.

pull/15/head
Jussi Pakkanen 11 years ago
parent cdee05082b
commit 0322579329
  1. 4
      ninjabackend.py
  2. 8
      test cases/vala/3 dep/gioprog.vala
  3. 9
      test cases/vala/3 dep/meson.build

@ -16,6 +16,7 @@ import backends
import environment
import build
import mlog
import dependencies
from meson_install import InstallData
from build import InvalidArguments
from coredata import MesonException
@ -455,6 +456,9 @@ class NinjaBackend(backends.Backend):
relsc = os.path.join(self.get_target_dir(target), target.get_basename() + '.dir', sc)
rel_s = os.path.join(self.build_to_src, s)
flags += ['--deps', relsc + '.d']
for d in target.external_deps:
if isinstance(d, dependencies.PkgConfigDependency):
flags += ['--pkg', d.name]
generated_c += [relsc]
element = NinjaBuildElement(relsc, valac.get_language() + '_COMPILER', rel_s)
element.add_item('FLAGS', flags)

@ -0,0 +1,8 @@
class GioProg {
public static int main(string[] args) {
var homedir = File.new_for_path(Environment.get_home_dir());
stdout.printf("Home directory as told by gio is " + homedir.get_path() + "\n");
return 0;
}
}

@ -0,0 +1,9 @@
project('giotest', 'vala', 'c')
glib = dependency('glib-2.0')
gobject = dependency('gobject-2.0')
gio = dependency('gio-2.0')
e = executable('gioprog', 'gioprog.vala',
deps : [glib, gobject, gio])
test('giotest', e)
Loading…
Cancel
Save