From 8c9f66fd17504a913b980fdd1a7427c446a7d37f Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Wed, 13 Mar 2024 06:41:25 -0700 Subject: [PATCH] :technologist: Use libhal-bootstrap/1.0.1 --- conanfile.py | 61 +++------------------------------------ test_package/conanfile.py | 16 ++-------- 2 files changed, 6 insertions(+), 71 deletions(-) diff --git a/conanfile.py b/conanfile.py index f1cc4fb..578464d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -15,10 +15,6 @@ # limitations under the License. from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout -from conan.tools.files import copy -from conan.tools.build import check_min_cppstd -import os required_conan_version = ">=2.0.14" @@ -33,62 +29,13 @@ class libhal_util_conan(ConanFile): "peripherals and devices using modern C++") topics = ("peripherals", "hardware", "abstraction", "devices", "hal") settings = "compiler", "build_type", "os", "arch" - exports_sources = ("include/*", "tests/*", "LICENSE", - "CMakeLists.txt", "src/*") - generators = "CMakeToolchain", "CMakeDeps" - @property - def _min_cppstd(self): - return "20" - - @property - def _compilers_minimum_version(self): - return { - "gcc": "11", - "clang": "14", - "apple-clang": "14.0.0" - } - - @property - def _bare_metal(self): - return self.settings.os == "baremetal" - - def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._min_cppstd) - - def build_requirements(self): - self.tool_requires("cmake/3.27.1") - self.tool_requires("libhal-cmake-util/3.0.1") - self.test_requires("boost-ext-ut/1.1.9") + python_requires = "libhal-bootstrap/[^1.0.0]" + python_requires_extend = "libhal-bootstrap.library" def requirements(self): - self.requires("libhal/[^3.0.0]", transitive_headers=True) - - def layout(self): - cmake_layout(self) - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - copy(self, - "LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder) - copy(self, - "*.h", - dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include")) - copy(self, - "*.hpp", - dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include")) - - cmake = CMake(self) - cmake.install() + bootstrap = self.python_requires["libhal-bootstrap"] + bootstrap.module.add_library_requirements(self) def package_info(self): self.cpp_info.libs = ["libhal-util"] diff --git a/test_package/conanfile.py b/test_package/conanfile.py index 33a0a1c..7ceb11c 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -15,26 +15,14 @@ # limitations under the License. from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - def build_requirements(self): - self.tool_requires("cmake/3.27.1") + python_requires = "libhal-bootstrap/[^1.0.0]" + python_requires_extend = "libhal-bootstrap.library_test_package" def requirements(self): self.requires(self.tested_reference_str) - - def layout(self): - cmake_layout(self) - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - pass