-
-
Notifications
You must be signed in to change notification settings - Fork 792
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
Library dependency finder ignores build_src_flags
#4253
Comments
Where is The only solution to this issue is to switch to a native GCC Preprocessor. Currently, PlatformIO uses a virtual SCons/Pythonbased Preprocessor. |
Flag is set through the command line As I understood the #3113 problem is with expressions and defines referencing other defines, which I have also happened to notice. SCons scanner still works out simple flags like this, though. |
|
Not yet renamed though, #4245, and grep does not find that name |
Thanks, the option has been finally renamed.
You have a typo here, please use |
...I have demonstrated that the option / flag works with build_flags = ... though! This is not a typo, it is intended to be used as a boolean. |
Do you have in [env]
platform = espressif8266
framework = arduino
build_flags =
-g
-DTHIS_IS_A_TEST=1 |
See https://github.com/mcspr/pio-scan-deps, updated with what works and what does not as environments. |
Thanks, this is a bug. We will fix it in 6.0. |
src_build_flags
build_src_flags
Please re-test with |
Everything works! Thank you. edit: should the test suite has this as a test case? |
Start by telling us what problem you’re trying to solve. Often a solution
already exists! Don’t send pull requests to implement new features without first getting our
support. Sometimes we leave features out on purpose to keep the project small.
Configuration
Operating system: Fedora 36
PlatformIO Version (
platformio --version
): PlatformIO Core, version 6.0.0a2Description of problem
MCVE of the currently not working code is at https://github.com/mcspr/pio-scan-deps
Latest action run reproduces the error below https://github.com/mcspr/pio-scan-deps/runs/6246889310
The project is:
Where
extra.cpp
conditionally includes a local libraryWhen
lib_ldf_mode = deep+
is set, PIO scanner will ignore the testlib.hGCC still picks it up, though, resulting in a failed build
While I have noticed that examples in documentation only mention the
build_flags = ...
as a way to modify the dependency scanner behaviour...I am not really sure whether this was intentional that project build flags are ignored?
Should the scanner do a 2nd pass with the project dependencies, while using the flags provided in the
src_build_flags
?Steps to Reproduce
See the repo
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
Plus, a dummy library consisting of
lib/testlib/src/testlib.h
andlib/testlib/src/testlib.cpp
. Both are empty.The text was updated successfully, but these errors were encountered: