Platformio build dependencies example as part of the project

I have a project with few github dependencies. I use Clion with platformio for the development and so far everything was running fine. (I don’t know what changed)

When I build a project, platformio also build everything it can find in dependencies, including tests and examples. I read in the documentation it’s a default behaviour and tested srcfolder and src-ignore library.json options which works fine.
However, are there any alternative to support legacy arduino libraries having source files at the root without library.properties or library.json ?

thanks

Without a library manifest in the root PlatformIO will try to traverse the library in search for what it thinks the real root of the library is. This sometimes works, sometimes it doesn’t. (see e.g. Library without includeDir unpredictable · Issue #3887 · platformio/platformio-core · GitHub). If you include libraries via lib_deps (in libs/ it does not matter, no such logic is applied, see folder structure here), make sure they have a manifest file.

Thank you Max.

The issue I have is on all dependencies of my project (RobTillaart/PCF8574@0.3.2 and olikraus/u8g2@2.28.8). They are included with lib_deps. For any reason platformio builds everything…

So now I’m more confused…

Define “everything”?

Do you have the project you’re having problems with uploaded somewhere?

I can not really upload. I’m trying to isolate the case.

By everything, I mean the library itself + its example folder + its test folder.

I cannot reproduce your problem. Using the platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
   RobTillaart/PCF8574@0.3.2
   olikraus/u8g2@2.28.8

with src\main.cpp

#include <Arduino.h>
#include <PCF8574.h>
#include <U8x8lib.h>


#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif

void setup() {}
void loop() {}

I get a normal compilation and only the library’s sourcecode is compiled, not any of the examples or test.

Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.0% (used 13224 bytes from 327680 bytes)
Flash: [==        ]  15.4% (used 201212 bytes from 1310720 bytes)
Building .pio\build\esp32dev\firmware.bin
esptool.py v3.1
Merged 1 ELF section
=========== [SUCCESS] Took 20.43 seconds ===========

Please show your full platformio.ini and a screenhot of the error / CLion window.

Never mind, my build options were wrong I was using --target Z_DUMMY_TARGET. Using Production solved my errors.