Skip to content

Commit

Permalink
✨ Add platform specific flag for add_demo_requirements
Browse files Browse the repository at this point in the history
Allows platform libraries to omit requiring themselves in demos.

- ⬆️ Bump to version 0.0.2
  • Loading branch information
kammce committed Mar 7, 2024
1 parent ded5d66 commit bbcb35d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
required_conan_version = ">=2.0.14"


def add_demo_requirements(conan_file: ConanFile):
platform = str(conan_file.options.platform)

if platform.startswith("lpc40"):
conan_file.output.warning("Using lpc40 platform library!!")
conan_file.requires("libhal-lpc40/[^3.0.0]")
conan_file.requires(
f"prebuilt-picolibc/{str(conan_file.settings.compiler.version)}")
conan_file.requires(f"libhal-exceptions/[^0.0.1]")

elif platform.startswith("stm32f1"):
conan_file.output.warning("Using stm32f1 platform library!!")
conan_file.requires("libhal-stm32f1/[^3.0.0]")
conan_file.requires(
f"prebuilt-picolibc/{str(conan_file.settings.compiler.version)}")
conan_file.requires(f"libhal-exceptions/[^0.0.1]")
def add_demo_requirements(conan_file: ConanFile, is_platform: bool = False):
if not is_platform:
platform = str(conan_file.options.platform)
if platform.startswith("lpc40"):
conan_file.output.warning("Using lpc40 platform library!!")
conan_file.requires("libhal-lpc40/[^3.0.0]")
conan_file.requires(f"libhal-exceptions/[^0.0.1]")

elif platform.startswith("stm32f1"):
conan_file.output.warning("Using stm32f1 platform library!!")
conan_file.requires("libhal-stm32f1/[^3.0.0]")
conan_file.requires(f"libhal-exceptions/[^0.0.1]")

if conan_file.settings.os == "baremetal":
compiler_version = str(conan_file.settings.compiler.version)
conan_file.requires("prebuilt-picolibc/" + compiler_version)

conan_file.requires("libhal-util/[^4.0.0]")

Expand Down Expand Up @@ -166,5 +166,5 @@ def test(self):

class libhal_bootstrap(ConanFile):
name = "libhal-bootstrap"
version = "0.0.1"
version = "0.0.2"
package_type = "python-require"

0 comments on commit bbcb35d

Please sign in to comment.