There are three switches to build static/shared libraries.
Here is the logic.
If BUILD_SHARED_LIBS is defined
If BUILD_SHARED_LIBS is ON
build only shared-library
Else
build only static-library
Endif
Else
If MSGPACK_ENABLE_SHARED is ON (default)
build shared-library
Endif
If MSGPACK_ENABLE_STATIC is ON (default)
build static-library
Endif
Endif
Here is common settings:
If you want to build both static/shared libraries, don't set switches.
If you want to build only shared-library, set BUILD_SHARED_LIBS=ON.
If you want to build only static-library, set BUILD_SHARED_LIBS=OFF.
Added lacked include files.
Added a test.
Added MSVC build settings on appveyor.
Added old MSVC workaround.
Fixed a variable definition point to meet ANSI-C.
libmsgpack.[a|so] is the library file for C++.
libmsgpackc.[a|so] is the library file for C.
Since version 1.0.0, the C++ parts of msgpack-c is a header only
library. So libmsgpack.* shouldn't be generated.
On the autotools building environment, removed libmsgpack.*
generation. On the cmake building environment, replaced libmsgpack.*
with libmsgpackc.* and set so-version to 2.0.0.
The example has some duplicated code that somewhat distracts from
the main processing loop. I think placing this into a separate
function improves readability of the code.