Skip to content

Provide build flags options to libraries #2908

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

Open
3 tasks done
Levi--G opened this issue May 3, 2025 · 1 comment
Open
3 tasks done

Provide build flags options to libraries #2908

Levi--G opened this issue May 3, 2025 · 1 comment
Labels
type: enhancement Proposed improvement

Comments

@Levi--G
Copy link

Levi--G commented May 3, 2025

Describe the request

I suggest adding the ability to add/remove platform properties (AKA "build properties", "compiler flags") and gui options via the library.properties metadata file.

My case

I created a PlatformIO library: https://github.com/Levi--G/USBLibrarySTM32. I am regularly asked to add support for using my library with Arduino IDE, but the lack of this capability makes it impossible for me to do so.

The reason is that the library requires the USB peripheral clock of the STM32 microcontroller to be enabled. This is controlled in the STM32 boards platform source code by preprocessor conditionals. So the library requires the -D USBCON and -D HAL_PCD_MODULE_ENABLED flags to be injected into the compilation commands.

Describe the current behavior

It is not possible for libraries to configure platform properties.

Arduino CLI version

63c44a4

Operating system

N/A

Operating system version

n/a

Additional context

Allowing the end user to set platform properties on a sketch level would be another solution.

Related

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@Levi--G

This comment has been minimized.

@arduino arduino locked and limited conversation to collaborators May 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

1 participant