diff --git a/dependencies.py b/dependencies.py index 8a66e24a1..20ead2a14 100644 --- a/dependencies.py +++ b/dependencies.py @@ -30,7 +30,7 @@ class DependencyException(MesonException): class Dependency(): def __init__(self): - pass + self.name = "null" def get_compile_flags(self): return [] @@ -45,6 +45,9 @@ class Dependency(): """Source files that need to be added to the target. As an example, gtest-all.cc when using GTest.""" return [] + + def get_name(self): + return self.name class PackageDependency(Dependency): # Custom detector, not pkg-config. def __init__(self, dep): @@ -63,13 +66,15 @@ class PackageDependency(Dependency): # Custom detector, not pkg-config. def get_sources(self): return self.dep.get_sources() -# This should be an InterpreterObject. Fix it. + def get_name(self): + return self.dep.get_name() class PkgConfigDependency(Dependency): pkgconfig_found = False - + def __init__(self, name, required): Dependency.__init__(self) + self.name = name if not PkgConfigDependency.pkgconfig_found: self.check_pkgconfig() @@ -147,9 +152,6 @@ class ExternalLibrary(Dependency): def found(self): return self.fullpath is not None - def get_name(self): - return self.name - def get_link_flags(self): if self.found(): return [self.fullpath] @@ -164,8 +166,10 @@ def find_external_dependency(name, kwargs): return PackageDependency(dep) return PkgConfigDependency(name, required) -class BoostDependency(): +class BoostDependency(Dependency): def __init__(self, kwargs): + Dependency.__init__(self) + self.name = 'boost' self.incdir = '/usr/include/boost' self.libdir = '/usr/lib' self.src_modules = {} @@ -177,7 +181,7 @@ class BoostDependency(): self.detect_src_modules() self.detect_lib_modules() self.validate_requested() - + def get_compile_flags(self): return [] @@ -241,6 +245,8 @@ class BoostDependency(): class GTestDependency(): def __init__(self, kwargs): + Dependency.__init__(self) + self.name = 'gtest' self.include_dir = '/usr/include' self.src_include_dir = '/usr/src/gtest' self.src_dir = '/usr/src/gtest/src' @@ -263,8 +269,10 @@ class GTestDependency(): def get_sources(self): return [self.all_src, self.main_src] -class GMockDependency(): +class GMockDependency(Dependency): def __init__(self, kwargs): + Dependency.__init__(self) + self.name = 'gmock' self.libdir = '/usr/lib' self.libname = 'libgmock.so' @@ -284,8 +292,10 @@ class GMockDependency(): fname = os.path.join(self.libdir, self.libname) return os.path.exists(fname) -class Qt5Dependency(): +class Qt5Dependency(Dependency): def __init__(self, kwargs): + Dependency.__init__(self) + self.name = 'qt5' self.root = '/usr' self.modules = [] mods = kwargs.get('modules', []) diff --git a/interpreter.py b/interpreter.py index 091ec785d..8257f2b4d 100755 --- a/interpreter.py +++ b/interpreter.py @@ -19,7 +19,7 @@ import nodes import environment import coredata import dependencies -import os, sys, platform +import os, sys, platform, copy class InterpreterException(Exception): pass @@ -307,7 +307,12 @@ class BuildTarget(InterpreterObject): else: raise InvalidArguments('Bad source in target %s.' % self.name) + def get_original_kwargs(self): + return self.kwargs + def process_kwargs(self, kwargs): + self.kwargs = copy.copy(kwargs) + kwargs.get('modules', []) self.need_install = kwargs.get('install', self.need_install) llist = kwargs.get('link_with', []) if not isinstance(llist, list): @@ -391,7 +396,6 @@ class BuildTarget(InterpreterObject): [self.add_external_dep(dep) for dep in args] def link(self, target): - target if not isinstance(target, StaticLibrary) and \ not isinstance(target, SharedLibrary): raise InvalidArguments('Link target is not library.') diff --git a/test cases/frameworks/4 qt5/meson.build b/test cases/frameworks/4 qt5/meson.build index 679624217..6431278b1 100644 --- a/test cases/frameworks/4 qt5/meson.build +++ b/test cases/frameworks/4 qt5/meson.build @@ -6,7 +6,6 @@ q5exe = executable('qt5test', sources : ['main.cpp', 'mainWindow.cpp'], moc_headers : ['mainWindow.h'], ui_files : 'mainWindow.ui', -deps : qt5dep\ -) +deps : qt5dep) add_test('qt5test', q5exe)