Skip to content

Commit f31a65b

Browse files
authored
✨ Add 'app' class (#42)
`app` is a carbon copy of the `demo` class. Separation between them is important so we we can make updates to either one separately as needed.
1 parent ae58302 commit f31a65b

2 files changed

Lines changed: 44 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Khalil Estell
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

conanfile.py

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Khalil Estell
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -82,6 +82,47 @@ def build(self):
8282
cmake.build()
8383

8484

85+
class app:
86+
settings = "compiler", "build_type", "os", "arch"
87+
options = {
88+
"platform": ["ANY"],
89+
"micromod_board": ["ANY"],
90+
}
91+
default_options = {
92+
"platform": "unspecified",
93+
"micromod_board": "unspecified",
94+
}
95+
96+
def layout(self):
97+
if "micromod" == str(self.options.platform):
98+
build_path = os.path.join("build",
99+
str(self.options.platform),
100+
str(self.options.micromod_board))
101+
cmake_layout(self, build_folder=build_path)
102+
else:
103+
build_path = os.path.join("build",
104+
str(self.options.platform))
105+
cmake_layout(self, build_folder=build_path)
106+
107+
def build_requirements(self):
108+
self.tool_requires("make/4.4.1")
109+
self.tool_requires("cmake/3.27.1")
110+
self.tool_requires("libhal-cmake-util/[^4.3.3]")
111+
112+
def generate(self):
113+
virt = VirtualBuildEnv(self)
114+
virt.generate()
115+
cmake = CMakeDeps(self)
116+
cmake.generate()
117+
tc = CMakeToolchain(self)
118+
tc.generate()
119+
120+
def build(self):
121+
cmake = CMake(self)
122+
cmake.configure()
123+
cmake.build()
124+
125+
85126
def add_library_requirements(conan_file: ConanFile,
86127
override_libhal_version: str | None = None,
87128
override_libhal_util_version: str | None = None):
@@ -219,5 +260,5 @@ def test(self):
219260

220261
class libhal_bootstrap(ConanFile):
221262
name = "libhal-bootstrap"
222-
version = "4.2.1"
263+
version = "4.3.0"
223264
package_type = "python-require"

0 commit comments

Comments
 (0)