Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

How can I build pmemkv statically? #1074

Open
bryanwux opened this issue Jul 26, 2022 · 2 comments
Open

How can I build pmemkv statically? #1074

bryanwux opened this issue Jul 26, 2022 · 2 comments

Comments

@bryanwux
Copy link

bryanwux commented Jul 26, 2022

QUESTION:

How can I build pmemkv statically?

Details

I am wondering why pmemkv only supports building as a shared library. Why not remove SHARED flag here

add_library(pmemkv SHARED ${SOURCE_FILES})

and
add_library(pmemkv_json_config SHARED ${SOURCE_FILES_JSON_CONFIG})

If users want to build it as a shared lib, they can manually set BUILD_SHARED_LIBS=on when cmake.

@lukaszstolarczuk
Copy link
Member

Hi,
I believe we can make some changes to allow static build, but the default value we'd like to provide is SHARED.

May I know what your use case is? It'd be nice to understand how you'd like to use our lib statically and what solution would you accept (if not BUILD_SHARED_LIBS=on).
Also, what version of pmemkv you're using - would it be all right to add this new CMake option to the master branch?

@bryanwux
Copy link
Author

bryanwux commented Jul 26, 2022

Hi @lukaszstolarczuk , thank you for your reply. I am using the version 1.5.0 of pmemkv. The use case is I am considering using pmemkv in envoy http cache. I know this is uncommon but enovy only supports statically builds. What about leave the default build option to SHARED then add a new option for static build?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants