Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧑‍💻 Use libhal-bootstrap/1.0.1 #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 4 additions & 57 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]
Expand Down
16 changes: 2 additions & 14 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading