Skip to content
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

[FR] Separated amalgamation header file for C API, or wrap the C++/C sections in an ifdef #3461

Open
oviano opened this issue Apr 1, 2023 · 2 comments

Comments

@oviano
Copy link
Contributor

oviano commented Apr 1, 2023

I have written a Botan-based crypto service provider for the SRT library:

Haivision/srt#2700

While looking at how to integrate Botan into the SRT CMake build system, I came across this:

https://github.com/Tectu/botan-cmake

This seems like a potential solution but since the SRT crypto framework is written in C, it requires the FFI Botan interface. However, the Botan amalgamation build includes everything in botan_all.h, which cannot be included in SRT because it contains a bunch of C++ classes etc.

So my suggestions are:

  1. Split "botan_all.h" into "botan_all_cpp.h" and "botan_all_c.h". Or maybe just leave botan_all.h as it is, but include "botan_all_ffi.h" containing just the FFI subset.

OR

  1. Wrap the C++ and C sections of the "botan_all.h" file in ifdefs that can then be defined prior to including "botan_all.h".

OR

Another solution?

@randombit
Copy link
Owner

Yeah good point. Probably we want to leave botan_all.h as it is and create a new FFI-specific header for anyone only using the C interface.

@oviano
Copy link
Contributor Author

oviano commented Apr 3, 2023

For now it seems that the three files ffi.h build.h and compiler.h are all that are required, but it would be good to reduce that to a single file!

I did have a look at the configure script but it was quite complex.

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

No branches or pull requests

2 participants