Skip to content

Provide a new cmake rule to compile openvpn3 as a static library #330

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

Open
YungRaj opened this issue Sep 9, 2024 · 3 comments
Open

Provide a new cmake rule to compile openvpn3 as a static library #330

YungRaj opened this issue Sep 9, 2024 · 3 comments

Comments

@YungRaj
Copy link

YungRaj commented Sep 9, 2024

Before I submit a pull request I want to hear people's thoughts on this.

@YungRaj YungRaj changed the title Provide an a new cmake rule to compile openvpn3 as a static library Provide a new cmake rule to compile openvpn3 as a static library Sep 9, 2024
@dimonpanik
Copy link

that's a good suggestion. in my job I could use a library. it's easier to update the library than the whole application

@schwabe
Copy link
Contributor

schwabe commented Jan 9, 2025

I don't think this will work without major refactoring. Currently OpenVPN3 is setup to be in part as header only project. You will face singnificant challenges doing this.

@YungRaj
Copy link
Author

YungRaj commented Jan 9, 2025

Yeah I realized this after creating the bug once I made changes that would compile the library as a static library. This turned out to be a pain in the arse because since the openvpn3 is a header only library, including only 1 or 2 headers from it pulls in pretty much the whole library into the compilation. This causes issues with the linker complaining about duplicate symbols.

I recommend cloning this library into your project and then including the headers yourself so that it eventually gets compiled to the same effect as using this as static library.

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

3 participants