These days quite a lot of projects use the really nice key-value database called LevelDB.
Sometimes you might need to compile LevelDB for whatever reason β of which I would not list here for the sake of my health. π
But we were surprised that LevelDB codebase only compiles a static lib, and not a shared one.
Then, totally by chance, we found out in this issue how to do it β saving us tons of time.
Just for documentation purposes, the steps are as follows.
First, change the CMakeLists.txt
file:
$ sed -i "s/add_library(leveldb \"\")/add_library(leveldb \"SHARED\")/g" CMakeLists.txt
And then, execute the cmake
command with some more options:
$ env BUILD_SHARED_LIBS=on cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .
In the end, you will see the output of a .so
or a .dylib
. π
πͺ π