diff options
-rw-r--r-- | backends.py | 4 | ||||
-rw-r--r-- | build.py | 5 | ||||
-rw-r--r-- | interpreter.py | 14 | ||||
-rw-r--r-- | test cases/common/51 pkgconfig-gen/installed_files.txt | 3 | ||||
-rw-r--r-- | test cases/common/51 pkgconfig-gen/meson.build | 2 |
5 files changed, 16 insertions, 12 deletions
diff --git a/backends.py b/backends.py index e2a9c43..6e710f4 100644 --- a/backends.py +++ b/backends.py @@ -352,7 +352,9 @@ class Backend(): ofile.write('-l%s ' % l.name) ofile.write('\n') ofile.write('CFlags: ') - for h in p.headerdirs.keys(): + for h in p.subdirs: + if h == '.': + h = '' ofile.write(os.path.join('-I${includedir}', h)) ofile.write(' ') ofile.write('\n') @@ -525,7 +525,7 @@ class ConfigurationData(): return self.values.keys() class PkgConfigGenerator(): - def __init__(self, libraries, headers, name, description, version, filebase): + def __init__(self, libraries, subdirs, name, description, version, filebase): self.libraries = [] for l in libraries: if hasattr(l, 'held_object'): @@ -533,8 +533,7 @@ class PkgConfigGenerator(): else: self.libraries.append(l) self.headerdirs = {} - for h in headers: - self.headerdirs[h.subdir] = True + self.subdirs = subdirs self.name = name self.description = description self.version = version diff --git a/interpreter.py b/interpreter.py index 7620ae7..9f84816 100644 --- a/interpreter.py +++ b/interpreter.py @@ -744,12 +744,12 @@ class Interpreter(): for l in libs: if not (isinstance(l, SharedLibraryHolder) or isinstance(l, StaticLibraryHolder)): raise InterpreterException('Library argument not a library object.') - headers = kwargs.get('headers', []) - if not isinstance(headers, list): - headers = [headers] - for h in headers: - if not isinstance(h, Headers): - raise InterpreterException('Header argument not a Headers object.') + subdirs = kwargs.get('subdirs', ['.']) + if not isinstance(subdirs, list): + subdirs = [subdirs] + for h in subdirs: + if not isinstance(h, str): + raise InterpreterException('Header argument not string.') version = kwargs.get('version', '') if not isinstance(version, str): raise InterpreterException('Version must be a string.') @@ -762,7 +762,7 @@ class Interpreter(): description = kwargs.get('description', None) if not isinstance(description, str): raise InterpreterException('Description is not a string.') - p = build.PkgConfigGenerator(libs, headers, name, description, version, filebase) + p = build.PkgConfigGenerator(libs, subdirs, name, description, version, filebase) self.build.pkgconfig_gens.append(p) def func_is_subproject(self, nodes, args, kwargs): diff --git a/test cases/common/51 pkgconfig-gen/installed_files.txt b/test cases/common/51 pkgconfig-gen/installed_files.txt new file mode 100644 index 0000000..547e530 --- /dev/null +++ b/test cases/common/51 pkgconfig-gen/installed_files.txt @@ -0,0 +1,3 @@ +include/simple.h +lib/libsimple.so +lib/pkgconfig/simple.pc diff --git a/test cases/common/51 pkgconfig-gen/meson.build b/test cases/common/51 pkgconfig-gen/meson.build index 0d1aa64..f0f907c 100644 --- a/test cases/common/51 pkgconfig-gen/meson.build +++ b/test cases/common/51 pkgconfig-gen/meson.build @@ -4,5 +4,5 @@ lib = shared_library('simple', 'simple.c', install : true) libver = '1.0' h = headers('simple.h') -pkgconfig_gen(libraries : lib, headers : h, version : libver, +pkgconfig_gen(libraries : lib, subdirs : '.', version : libver, name : 'libsimple', filebase : 'simple', description : 'A simple demo library.') |