Is it possible to have code from one module in the /lib
folder link to code in another module also in /lib
?
Our local code is currently all in the /src
directory, meaning that we have to use the test_build_src
flag to be able to run the unit tests.
Best-practise says we should break the code out into modules in the /lib
folder, which would be much neater because it would allow us to put platform-specific code into separate libraries from “core” code. We also have multiple versions of our product to be deployed in different vehicles, each of which has vehicle-specific code which we’d love to keep organised in separate libraries.
The problem is that the platform-specific code or vehicle-specific code needs to implement interfaces declared in the core library so that they can be configured/injected by a file in /src
. It appears that each library in the /lib
folder is compiled separately, so the platform-specific files can’t link to the interfaces and the build fails.
We don’t want to publish any of the modules to the package library as they’re private and specific to our app (and they’re under active development so we wouldn’t want to have to publish new versions each time there’s a change to a bit of code).
Are we missing something obvious? A build flag or platformio.ini
setting maybe?