Also do not help, because there is template header that is available only after library was built …
How properly add library to espressif32 project ?
Is an aded library built during build of main project ?
Maybe I need somehow to add artifacts to project CMakeList.txt file ?
Hi @redradist, there was a flaw in the manifest file for the LwGPS v2.2.0 library which is fixed in the development branch, so I’d recommend installing the library directly from the repository:
I see, unfortunately, CMake scripts are not executed when PlatformIO builds third-party libraries. The author of that library also haven’t implemented a proper integration with PlatformIO, so you’ll need to do it on your side. Fortunately, it’s not that hard, just create an extra script that will handle the same logic as in the CMake file:
[env:ttgo-t-beam]
platform = espressif32
board = ttgo-t-beam
framework = espidf
lib_deps =
https://github.com/MaJerle/lwgps.git#f1f5d32
; A special workaround for the dynamic generation of the
; "lwgps_opts.h" config file for LwGPS
extra_scripts =
generate_lwgps_config_file.py
Where generate_lwgps_config_file.py: is something like this
import os
import shutil
Import("env")
lwgps_lib_path = env.subst(os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV", "LwGPS"))
lwgps_config_file = os.path.join(
lwgps_lib_path, "lwgps", "src", "include", "lwgps", "lwgps_opts.h"
)
if not os.path.isfile(lwgps_config_file):
print(
"Warning! `lwgps_opts.h` file was not found. A new one will be created from `lwgps_opts_template.h`!"
)
template_config = lwgps_config_file.replace("lwgps_opts.h", "lwgps_opts_template.h")
assert os.path.isfile(
template_config
), "Error: missing the template configuration file `lwgps_opts_template.h`!"
shutil.copyfile(template_config, lwgps_config_file)
assert os.path.isfile(lwgps_config_file), "Error: `lwgps_opts.h` was not copied!"
But based on what was said I’ve a couple new questions:
How this library passed CI during registration on PlatformIO Registry ??
For example, everything that goes in conan-center-index is passing CI, that is how central repo can guarantee that library is working properly
Why some symbols are not defined in native python for script generate_lwgps_config_file.py ?
Is it some trick parts of Scons ?
Because I expect that file with .py extension would be a valid python file, but Import is undefined, env is imported not by proper python mechanism, but using Import … too strange for me …
Do you conside adding CI in future ?
Also if your PlatformIO registry is located on GitHub then Travis CI for open-source projects provide free continuous integration
I see on this page PlatformIO Registry that you have on Community Plan as well as bunch of proprietary registry …
I suggest to move Community Registry on GitHub, as it was done for conan-center-index.
It could be done by providing all link to public repositories as submodules and new library registration as pull-request that will be merged automatically by bot after CI is passed
Because without CI I do not completely understand what problem solves PlaltfomrIO Registry if nothing is checked on it …
As customer I expect that if library available on Registry than it should work on claimed platforms and frameworks