Can have multiple different configurations of the same dependency.

pull/15/head
Jussi Pakkanen 12 years ago
parent 137365b5b3
commit 3d4aad9e0d
  1. 2
      coredata.py
  2. 13
      dependencies.py
  3. 7
      interpreter.py
  4. 9
      test cases/frameworks/1 boost/meson.build
  5. 12
      test cases/frameworks/1 boost/nolinkexe.cc

@ -72,4 +72,4 @@ forbidden_target_names = {'clean': None,
class MesonException(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(args, kwargs)
Exception.__init__(self, *args, **kwargs)

@ -25,8 +25,8 @@ import os, stat, glob, subprocess, shutil
from coredata import MesonException
class DependencyException(MesonException):
def __init__(self, args, **kwargs):
MesonException.__init__(args, kwargs)
def __init__(self, *args, **kwargs):
MesonException.__init__(self, *args, **kwargs)
class Dependency():
def __init__(self):
@ -322,6 +322,15 @@ class Qt5Dependency():
return False
return True
def get_dep_identifier(name, kwargs):
elements = [name]
modlist = kwargs.get('modules', [])
if isinstance(modlist, str):
modlist = [modlist]
for module in modlist:
elements.append(module)
return '/'.join(elements)
# This has to be at the end so the classes it references
# are defined.
packages = {'boost': BoostDependency,

@ -680,13 +680,14 @@ class Interpreter():
def func_find_dep(self, node, args, kwargs):
self.validate_arguments(args, 1, [str])
name = args[0]
if name in self.coredata.deps:
dep = self.coredata.deps[name]
identifier = dependencies.get_dep_identifier(name, kwargs)
if identifier in self.coredata.deps:
dep = self.coredata.deps[identifier]
else:
dep = dependencies.Dependency() # Returns always false for dep.found()
if not dep.found():
dep = dependencies.find_external_dependency(name, kwargs)
self.coredata.deps[name] = dep
self.coredata.deps[identifier] = dep
return dep
def func_executable(self, node, args, kwargs):

@ -1,11 +1,14 @@
project('boosttest', 'cxx')
# Use a Boost module that requires a shared library.
# Eventually we would like to be able to detect Boost
# multiple times with different library combinations.
# We want to have multiple separate configurations of Boost
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.
nolinkdep = find_dep('boost', modules: 'utility', required : true)
linkdep = find_dep('boost', modules : 'thread', required : true)
nolinkexe = executable('nolinkedexe', 'nolinkexe.cc', deps : nolinkdep)
linkexe = executable('linkedexe', 'linkexe.cc', deps : linkdep)
add_test('Boost nolinktext', nolinkexe)
add_test('Boost linktext', linkexe)

@ -0,0 +1,12 @@
#include<boost/utility.hpp>
class MyClass : boost::noncopyable {
public:
MyClass() {};
~MyClass() {};
};
int main(int argc, char **argv) {
MyClass obj;
return 0;
}
Loading…
Cancel
Save