diff options
author | Vili Väinölä <vilivainola@gmail.com> | 2020-06-14 14:16:52 +0300 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-06-14 15:33:14 +0200 |
commit | 977dc4d19f849ed5db39d1d2399e506969aee709 (patch) | |
tree | 943cc6f7e45ce9ad09228dfe0bb1825334a61758 | |
parent | e121942fcd1a5853618a5b9ba1bc01ed10acf4c4 (diff) | |
download | meson-977dc4d19f849ed5db39d1d2399e506969aee709.zip meson-977dc4d19f849ed5db39d1d2399e506969aee709.tar.gz meson-977dc4d19f849ed5db39d1d2399e506969aee709.tar.bz2 |
Use cmake args also when calling get_cmake_info
- vcpkg libraries are not found when given cmake_toolchain_file and vcpkg_target_triplet as cmake_args when looking for the dependency if the first call to cmake has different arguments. The libraries are found if the first call has same arguments or if the CMakeCache.txt is deleted in call_with_fake_build.
-rw-r--r-- | mesonbuild/dependencies/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index eed714a..23701da 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1078,8 +1078,9 @@ class CMakeDependency(ExternalDependency): # Setup the trace parser self.traceparser = CMakeTraceParser(self.cmakebin.version(), self._get_build_dir()) + cm_args = stringlistify(extract_as_list(kwargs, 'cmake_args')) if CMakeDependency.class_cmakeinfo[self.for_machine] is None: - CMakeDependency.class_cmakeinfo[self.for_machine] = self._get_cmake_info() + CMakeDependency.class_cmakeinfo[self.for_machine] = self._get_cmake_info(cm_args) self.cmakeinfo = CMakeDependency.class_cmakeinfo[self.for_machine] if self.cmakeinfo is None: raise self._gen_exception('Unable to obtain CMake system information') @@ -1089,10 +1090,8 @@ class CMakeDependency(ExternalDependency): modules += [(x, False) for x in stringlistify(extract_as_list(kwargs, 'optional_modules'))] cm_path = stringlistify(extract_as_list(kwargs, 'cmake_module_path')) cm_path = [x if os.path.isabs(x) else os.path.join(environment.get_source_dir(), x) for x in cm_path] - cm_args = stringlistify(extract_as_list(kwargs, 'cmake_args')) if cm_path: cm_args.append('-DCMAKE_MODULE_PATH=' + ';'.join(cm_path)) - if not self._preliminary_find_check(name, cm_path, self.cmakebin.get_cmake_prefix_paths(), environment.machines[self.for_machine]): mlog.debug('Preliminary CMake check failed. Aborting.') return @@ -1103,7 +1102,7 @@ class CMakeDependency(ExternalDependency): return s.format(self.__class__.__name__, self.name, self.is_found, self.version_reqs) - def _get_cmake_info(self): + def _get_cmake_info(self, cm_args): mlog.debug("Extracting basic cmake information") res = {} @@ -1122,6 +1121,7 @@ class CMakeDependency(ExternalDependency): # Prepare options cmake_opts = temp_parser.trace_args() + ['.'] + cmake_opts += cm_args if len(i) > 0: cmake_opts = ['-G', i] + cmake_opts |