Skip to content

Comments

Add platformio library definition and C++ compatibility#4

Merged
DavyLandman merged 4 commits intoDavyLandman:mainfrom
rabbitholecomputing:main
Aug 13, 2025
Merged

Add platformio library definition and C++ compatibility#4
DavyLandman merged 4 commits intoDavyLandman:mainfrom
rabbitholecomputing:main

Conversation

@PetteriAimonen
Copy link
Contributor

This pull request adds:

  • library.json so that the library can be easily included in a platformio project
  • extern "C" in headers so that it can be included in a C++ main program

@DavyLandman
Copy link
Owner

Thanks @PetteriAimonen , great!

I would prefer it if platformio didn't use the GH code, but the result of the algamize.sh script that gets into a release. (and also, only use releases, not track the main branch). Can you figure out how to configure that?

That way we also dont'need to add the extern "C" headers, since that is already done by the algamize script.

@PetteriAimonen
Copy link
Contributor Author

Hmm, I prefer the actual files, because that makes it easier to debug and modify if needed.
I think the single-file approach is useful when the files are being included in a build manually, but platformio automatically includes the needed files so it doesn't feel that useful.

In any case, I think platformio can only use files from the repository and not from the releases.

@DavyLandman
Copy link
Owner

Okay, well the single was a workaround for c/c++ lacking a proper package system. So platformio is at least a package system.

There are some speed/size benefits for the single file, but that might not be worth it.

Could you then change the algamize script to not add the extern C headers, since they're already in the separate header files?

@DavyLandman DavyLandman merged commit 09edebe into DavyLandman:main Aug 13, 2025
1 check passed
@PetteriAimonen
Copy link
Contributor Author

Thanks for merging!

Personally I find it just fine to include libraries by repository, the platformio publishing has always felt like an annoying extra step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants