summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules/__init__.py')
-rw-r--r--mesonbuild/modules/__init__.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py
index e69de29bb..8986d7a5c 100644
--- a/mesonbuild/modules/__init__.py
+++ b/mesonbuild/modules/__init__.py
@@ -0,0 +1,34 @@
+from .. import build
+from .. import dependencies
+
+_found_programs = {}
+
+def find_program(program_name, target_name):
+ if program_name in _found_programs:
+ return _found_programs[program_name]
+ program = dependencies.ExternalProgram(program_name)
+ if not program.found():
+ m = "Target {!r} can't be generated as {!r} could not be found"
+ raise MesonException(m.format(target_name, program_name))
+ _found_programs[program_name] = program
+ return program
+
+class GResourceTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+class GResourceHeaderTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+class GirTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+class TypelibTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)
+
+class VapiTarget(build.CustomTarget):
+ def __init__(self, name, subdir, kwargs):
+ super().__init__(name, subdir, kwargs)