-
-
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
BuildDependentLibraries ignores src_filter #570
Comments
Do you mean this functionality #289? |
I do not think it is related. Let me try to explain this in more detail. In the above example I have to folders below src with one main.cpp file each. I used src_filter to be able to select the main.cpp file I want to compile and this works quite well. The main.cpp files are using different libraries. the one in display is using the FastLed library for example. If I now build the trigger environment which is NOT using the fastled library it is still being compiled during the build process. I think the reason for this is that BuildDependentLibraries is looking at ALL files in the source folder, finds both main.cpp files, extracts the includes and then builds the libraries. |
@maru-sama Thanks, I got you now. This is a bug. |
I want to note that if library is not used in source code but IS BUILT and LINKED, GCC Linker will ignore it because there doesn't exist any reference to it. Of course, PlatformIO should ignore them. I mean that your code should work well with the current version of PlatformIO. |
I had a look at the linking command and apparently it is not linked in either. So apparently this logic is fine as well. Right now this is really only affecting the build-time. |
I've just changed it to "enhancement" and will fix together with the rest lib-related issues in PlatformIO 3.0. PlatformIO 2.0 is very stable and I don't want to break it. Library Dependencies Finder (LDF) has complicated logic. |
Perfect |
Resolved in f8db1d1 |
* develop: Fix incorrect line order when converting from INO to CPP and pointer is used Fix unit test Notify about `version` field when creating library Add support for SparkFun Blynk Board Return valid exit code from ``plaformio test`` command Disable SSL Server-Name-Indication for Python < 2.7.9 Version bump to 3.0.1 (issue #772) Disable temporary SSL for PlatformIO services // Resolve #772 Version bump to 3.0.0 (issues #770, #766, #747, #730, #765, #640, #659, #742, #459, #542, #763, #759, #753, #757, #749, #748, #745, #519, #709, #743, #413, #498, #410, #740, #361, #414, #554, #732, #588, #475, #461, #101, #719, #721, #537, #415, #522, #289, #556, #570, #456, #617, #432, #408, #479, #667, #510) Fix menu height for docs Fix issue with multiple archives when linking firmware Add migration guide for PIO2 to PIO3 Search libraries by headers/includes with ``platformio lib search --header`` option Update pio run command examples Add Unit Testing Demo Update PIO Plus badge title and link Add PlatformIO Plus badge Add links to PlatformIO Plus
I recently started using the src_filter directive to create two different firmwares in one project. Both of them are running on the same platform but have a different functionality and use different libraries. While compiling one of the environments I noticed that Libraries were compiled which were referenced in the other main file but not in the current file. Looking at https://github.com/platformio/platformio/blob/4c4682f45709ad54da5293eb654bff9bbcc05c44/platformio/builder/tools/platformio.py#L224 I saw that BuildDependentLibraries apparently does not use src_filter. While this does not affect the final firmware binary it increases the build time.
If I compile trigger here the main.cpp file in display is actually parsed as well and all the libs referenced there are also build, although they are not referenced in the main.cpp file inside trigger.
The text was updated successfully, but these errors were encountered: