From d96fe5e7537cdd9eadb3fe6359d3c86e5dc1cb56 Mon Sep 17 00:00:00 2001 From: Iikka Eklund Date: Tue, 7 Sep 2021 11:48:11 +0300 Subject: [PATCH] Conan: Filter cmake_args that should not be included in package_id The qtbase Conan recipe has 'cmake_args_qtbase" option to pass cmake arguments. Some of the cmake arguments should not be included in the package_id checksum of the Conan package. Filter these out when generating the package_id. Examples: - -DCMAKE_C_COMPILER_LAUNCHER=sccache - -DCMAKE_CXX_COMPILER_LAUNCHER=sccache - -DFEATURE_headersclean=.. - -DPostgreSQL_ROOT=.. Those arguments which are specific to Qt CI build environment are filtered out. This makes the pre-built Conan binary packages more usable for the end users because Conan would enforce a build from sources if the checksum(s) would not match. Pick-to: 6.2 Task-number: QTBUG-96230 Change-Id: I076a57427614fdf4bf9138402e247d63f1ce15d9 Reviewed-by: Toni Saario --- conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conanfile.py b/conanfile.py index 531fa59f3b..a75c31dd22 100644 --- a/conanfile.py +++ b/conanfile.py @@ -460,6 +460,13 @@ class QtBase(ConanFile): for item in rm_list: if item in self.info.options: delattr(self.info.options, item) + # filter also those cmake options that should not end up in the package_id + if hasattr(self.info.options, "cmake_args_qtbase"): + _filter = self.python_requires[ + "qt-conan-common" + ].module.filter_cmake_args_for_package_id + + self.info.options.cmake_args_qtbase = _filter(self.info.options.cmake_args_qtbase) def deploy(self): self.copy("*") # copy from current package