aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/platform.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-06-05 03:29:40 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-06-09 20:21:01 +0530
commit0c83f8352d288134ede8f4b8854e455007ce02b7 (patch)
tree61044ab368b3e57540f2b43fba1418f4d2652a78 /mesonbuild/dependencies/platform.py
parent22cfd44221ada3219d9096e15dc8b00d32e0f9f6 (diff)
downloadmeson-0c83f8352d288134ede8f4b8854e455007ce02b7.zip
meson-0c83f8352d288134ede8f4b8854e455007ce02b7.tar.gz
meson-0c83f8352d288134ede8f4b8854e455007ce02b7.tar.bz2
dependencies: Add a new class ExternalDependency
This class now consolidates a lot of the logic that each external dependency was duplicating in its class definition. All external dependencies now set: * self.version * self.compile_args and self.link_args * self.is_found (if found) * self.sources * etc And the abstract ExternalDependency class defines the methods that will fetch those properties. Some classes still override that for various reasons, but those should also be migrated to properties as far as possible. Next step is to consolidate and standardize the way in which we call 'configuration binaries' such as sdl2-config, llvm-config, pkg-config, etc. Currently each class has to duplicate code involved with that even though the format is very similar. Currently only pkg-config supports multiple version requirements, and some classes don't even properly check the version requirement. That will also become easier now.
Diffstat (limited to 'mesonbuild/dependencies/platform.py')
-rw-r--r--mesonbuild/dependencies/platform.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/mesonbuild/dependencies/platform.py b/mesonbuild/dependencies/platform.py
index cd46412..95ab727 100644
--- a/mesonbuild/dependencies/platform.py
+++ b/mesonbuild/dependencies/platform.py
@@ -17,25 +17,21 @@
from .. import mesonlib
-from .base import Dependency, DependencyException
+from .base import ExternalDependency, DependencyException
-class AppleFrameworks(Dependency):
- def __init__(self, environment, kwargs):
- Dependency.__init__(self, 'appleframeworks', kwargs)
+class AppleFrameworks(ExternalDependency):
+ def __init__(self, env, kwargs):
+ super().__init__('appleframeworks', env, None, kwargs)
modules = kwargs.get('modules', [])
if isinstance(modules, str):
modules = [modules]
if not modules:
raise DependencyException("AppleFrameworks dependency requires at least one module.")
self.frameworks = modules
-
- def get_link_args(self):
- args = []
+ # FIXME: Use self.compiler to check if the frameworks are available
for f in self.frameworks:
- args.append('-framework')
- args.append(f)
- return args
+ self.link_args += ['-framework', f]
def found(self):
return mesonlib.is_osx()