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.
Add support for CMake find_package command to msgpack. The package
exports the two targets msgpackc-static and msgpackc if shared is
enabled. The CMake find_package command works after installation
of msgpack and during build of another project which adds msgpack
as sub project via add_subdirectory command.
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
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.
msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.
Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
If MSGPACK_DISABLE_LEGACY_CONVERT is defined, msgpack::object::convert(T*) is removed.
Added MSGPACK_DISABLE_LEGACY_CONVERT to build system and documents.
Please define MSGPACK_DISABLE_LEGACY_CONVERT and update your code as follows:
Replace
int i;
obj.convert(&i); // Removed pointer version
with
int i;
obj.convert(i); // Reference version
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.
Replaced boost/ with msgpack/ and BOOST with MSGPACK in Boost.Preprocessor files.
Renamed existing macron in versioning.hpp to avoid confict with MSGPACK_PP_*.
Removed MSGPACK_USE_BOOST requirement from MSGPACK_DEFINE_MAP.