From 5be0a3b4ae790a5eb0044bcb0c6bec9b49a431dc Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Wed, 29 Mar 2023 17:48:50 -0500 Subject: [PATCH 1/2] apr: Remove settings_build workaround for tools.cross_building As discussed in https://github.com/conan-io/conan-center-index/pull/6622#discussion_r685814490 conan 1.38.0 and up have the new conan.tools.build.cross_building which compares build vs host settings, without the fallback on os_build/arch_build that the old tools.cross_compiling has. The recipe was converted in #14797 to use conan.tools.build.cross_building and required_conan_version = ">=1.53.0", making the workaround is obsolete. --- recipes/apr/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py index 1708ae7135970..3206ab4f8a206 100644 --- a/recipes/apr/all/conanfile.py +++ b/recipes/apr/all/conanfile.py @@ -68,8 +68,8 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks") + if cross_building(self): def build_requirements(self): if not is_msvc(self): From 0b11e420e80c882c137abe003375f1fd4de52adb Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Wed, 29 Mar 2023 17:57:57 -0500 Subject: [PATCH 2/2] apr: Loosen the cross-building restriction From all the discussion I found in #6622, the issue which motivated a "doesn't support cross-build yet" is the use of is AC_TRY_RUN checks in ./configure. That's not an issue when consuming existing binaries, so this check belongs in validate_build (since conan 1.51.0). It also doesn't apply to MSVC which uses CMake rather than autoconf; There's no use of try_compile or try_run in the CMake project. --- recipes/apr/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py index 3206ab4f8a206..bc24c632ae07f 100644 --- a/recipes/apr/all/conanfile.py +++ b/recipes/apr/all/conanfile.py @@ -67,9 +67,9 @@ def layout(self): else: basic_layout(self, src_folder="src") - def validate(self): - raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks") - if cross_building(self): + def validate_build(self): + if cross_building(self) and not is_msvc(self): + raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks in autoconf") def build_requirements(self): if not is_msvc(self):