diff options
-rw-r--r-- | dependencies.py | 21 | ||||
-rw-r--r-- | environment.py | 3 | ||||
-rw-r--r-- | interpreter.py | 5 | ||||
-rw-r--r-- | test cases/frameworks/1 boost/meson.build | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/dependencies.py b/dependencies.py index c5089bb..b3186d5 100644 --- a/dependencies.py +++ b/dependencies.py @@ -177,7 +177,6 @@ class BoostDependency(Dependency): Dependency.__init__(self) self.name = 'boost' self.incdir = '/usr/include/boost' - self.libdir = '/usr/lib' self.src_modules = {} self.lib_modules = {} self.lib_modules_mt = {} @@ -240,15 +239,17 @@ class BoostDependency(Dependency): def detect_lib_modules(self): globber = 'libboost_*.so' # FIXME, make platform independent. - for entry in glob.glob(os.path.join(self.libdir, globber)): - lib = os.path.basename(entry) - name = lib.split('.')[0].split('_', 1)[-1] - # I'm not 100% sure what to do here. Some distros - # have modules such as thread only as -mt versions. - if entry.endswith('-mt.so'): - self.lib_modules_mt[name] = True - else: - self.lib_modules[name] = True + libdirs = environment.get_library_dirs() + for libdir in libdirs: + for entry in glob.glob(os.path.join(libdir, globber)): + lib = os.path.basename(entry) + name = lib.split('.')[0].split('_', 1)[-1] + # I'm not 100% sure what to do here. Some distros + # have modules such as thread only as -mt versions. + if entry.endswith('-mt.so'): + self.lib_modules_mt[name] = True + else: + self.lib_modules[name] = True def get_link_flags(self): flags = [] # Fixme, add -L if necessary. diff --git a/environment.py b/environment.py index 0b7e3c6..cb62a8b 100644 --- a/environment.py +++ b/environment.py @@ -940,6 +940,9 @@ class Environment(): return trial def get_library_dirs(self): + return get_library_dirs() + +def get_library_dirs(): if is_windows(): return ['C:/mingw/lib'] # Fixme if is_osx(): diff --git a/interpreter.py b/interpreter.py index 474c2b1..5a7027c 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1083,7 +1083,10 @@ class Interpreter(): self.subdir = subdir buildfilename = os.path.join(self.subdir, environment.build_filename) self.build_def_files.append(buildfilename) - code = open(os.path.join(self.environment.get_source_dir(), buildfilename)).read() + absname = os.path.join(self.environment.get_source_dir(), buildfilename) + if not os.path.isfile(absname): + raise InterpreterException('Nonexistant build def file %s.' % buildfilename) + code = open(absname).read() assert(isinstance(code, str)) try: codeblock = mparser.build_ast(code) diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build index 033cb22..896225f 100644 --- a/test cases/frameworks/1 boost/meson.build +++ b/test cases/frameworks/1 boost/meson.build @@ -5,7 +5,7 @@ project('boosttest', 'cpp') # Use one without a library dependency and one with it. nolinkdep = dependency('boost', modules: 'utility') -linkdep = dependency('boost', modules : 'thread') +linkdep = dependency('boost', modules : ['thread', 'system']) nolinkexe = executable('nolinkedexe', 'nolinkexe.cc', deps : nolinkdep) linkexe = executable('linkedexe', 'linkexe.cc', deps : linkdep) |