openvpn3 icon indicating copy to clipboard operation
openvpn3 copied to clipboard

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

Open YungRaj opened this issue 1 year ago • 3 comments

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

YungRaj avatar Sep 09 '24 19:09 YungRaj

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

dimonpanik avatar Jan 09 '25 16:01 dimonpanik

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.

schwabe avatar Jan 09 '25 17:01 schwabe

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.

YungRaj avatar Jan 09 '25 21:01 YungRaj