aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/utils/universal.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/utils/universal.py')
-rw-r--r--mesonbuild/utils/universal.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index aaefbc5..a8f2d97 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2020 The Meson development team
+# Copyright 2012-2022 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -94,6 +94,7 @@ __all__ = [
'get_compiler_for_source',
'get_filenames_templates_dict',
'get_library_dirs',
+ 'get_opaque_data',
'get_variable_regex',
'get_wine_shortpath',
'git',
@@ -2277,3 +2278,21 @@ def first(iter: T.Iterable[_T], predicate: T.Callable[[_T], bool]) -> T.Optional
if predicate(i):
return i
return None
+
+class OpaqueData:
+ def __init__(self, scratch, out, stamp, dep):
+ self.scratch = scratch
+ self.out = out
+ self.stamp = stamp
+ self.dep = dep
+
+def get_opaque_data(subproject, target_name):
+ if subproject:
+ sub_str = subproject + '_'
+ else:
+ sub_str = ''
+ gendir = 'meson-gen'
+ return OpaqueData(os.path.join(gendir, sub_str, target_name + '_s'),
+ os.path.join(gendir, sub_str, target_name),
+ target_name + '.stamp',
+ target_name + '.d')