diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-02-18 15:03:21 -0800 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-02-19 07:07:35 +0530 |
commit | 73ddc014774102b378bb89bf9d4801d7b231b745 (patch) | |
tree | 1f478c6cb10c9ece2ec81d979be9b38e31c07223 /mesonbuild | |
parent | 52d36aaec13966b68994764191c8881edc92291e (diff) | |
download | meson-73ddc014774102b378bb89bf9d4801d7b231b745.zip meson-73ddc014774102b378bb89bf9d4801d7b231b745.tar.gz meson-73ddc014774102b378bb89bf9d4801d7b231b745.tar.bz2 |
modules/cmake: Add a found() method to the cmake subproject
Just like the native meson subproject has.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/cmake.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 03176d8..6c4098b 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -66,6 +66,7 @@ class CMakeSubprojectHolder(InterpreterObject, ObjectHolder): 'target': self.target, 'target_type': self.target_type, 'target_list': self.target_list, + 'found': self.found_method, }) def _args_to_info(self, args): @@ -110,6 +111,13 @@ class CMakeSubprojectHolder(InterpreterObject, ObjectHolder): def target_list(self, args, kwargs): return self.held_object.cm_interpreter.target_list() + @noPosargs + @permittedKwargs({}) + @FeatureNew('CMakeSubproject.found()', '0.53.2') + def found_method(self, args, kwargs): + return self.held_object is not None + + class CmakeModule(ExtensionModule): cmake_detected = False cmake_root = None |