153 Commits

Author SHA1 Message Date
Takatoshi Kondo
28cfb1ff81 Boost.Test has dropped C++03 support.
msgpack-c adjusted it.
2024-08-06 11:38:49 +09:00
Takatoshi Kondo
232fff18d4 Fixed cmake warnings. 2024-08-06 10:26:03 +09:00
Uy Ha
818d87c9cb add option in CMake 2023-07-03 13:50:37 +00:00
Takatoshi Kondo
ec8895155c Unify all package related names to msgpack-cxx.
Update the version to 6.0.0.
2023-02-28 10:52:21 +09:00
Silvio Traversaro
f6d4704605
Change CMake package name of C++ library to msgpackc-cxx 2023-01-05 15:37:01 +01:00
Takatoshi Kondo
12be5d06e3 Fixed #1025.
Propagate compiler options that are decided by cmake options to the
parent project.
2022-08-06 10:58:36 +09:00
James McCoy
b4d800e6e4
Install version/config files under CMAKE_INSTALL_LIBDIR
Prior to the c_master/cpp_master split, this is where the files were
installed (c.f., 6e7deb8091/CMakeLists.txt (L454))
but this was changed to use "lib/" directly when updating the C++-only
packaging.

Re-instate the use of CMAKE_INSTALL_LIBDIR so the user can control where
they are installed and they follow the typical convention for location.
2022-02-13 17:05:08 -05:00
Takatoshi Kondo
066d509a68 Minimall supported build without boost.
To remove boost dependency, `-DMSGPACK_USE_BOOST=OFF` for cmake.
By default, `-DMSGPACK_USE_BOOST` is `ON`.
NOTE: In order to build tests `-DMSGPACK_USE_BOOST=ON` is required.

For C++ compiler, the option `-DMSGPACK_NO_BOOST` is required to remove
boost.
2022-02-07 22:32:59 +09:00
Louis R. Marascio
b4dcae20cc Add option MSGPACK_BUILD_DOCS.
This option explicitly controls the generation of targets related to
Doxygen generation, rather than relying solely on whether Doxygen is
discovered.

It is enabled by default to preserve existing behavior, but if disabled
then no Doxygen targets will be generated. This is useful when the
library is included via CMake's `add_subdirectory()`.
2021-09-22 11:40:40 -05:00
Daniil Kovalev
4ed6b45abd Add MSGPACK_USE_STATIC_BOOST cmake option 2021-08-30 23:01:49 +03:00
Daniil Kovalev
25d6f84f3c Fix cmake to support versions 3.1 and above
VERSION_GREATER_EQUAL is available since cmake 3.7 only
2021-07-07 18:11:43 +03:00
Daniil Kovalev
4022c2fc00 Fix appveyor build 2021-07-04 13:25:25 +03:00
Daniil Kovalev
7b7615a6d9
Modernize codebase
- Enhance CMakeLists.txt files.
- Move to Boost Test from Google Test to support pre-C++11 compilers.
- Add more configurations on CI matrix builds.
- Other minor fixes
2021-07-01 18:17:20 +03:00
Daniil Kovalev
77045f13bb Add tests for std::span adaptor 2021-05-10 22:41:10 +03:00
Daniil Kovalev
388891edad Add support for more binary buffer types
Add support for the following types:
- `std::array<std::byte>`
- `std::span<char>`
- `std::span<unsigned char>`
- `std::span<std::byte>`
2021-05-10 16:06:26 +03:00
Arvid Norlander
04726a5acf Implement issue #923: Make boost timer optional 2020-10-16 10:51:49 +02:00
Takatoshi Kondo
14763a8b31 Fixed #905.
Added compiler version cheking for atomic test for older compilers on cmake.
2020-08-01 08:58:36 +09:00
Dan Horák
498fe28b43 reduce dependency on boost::context
The Boost Context module is required only for certain configurations, so adapt
the build system checks to it.
2020-06-09 12:48:19 +02:00
yuangongji
2f5b137997 remove C part in source code 2020-06-05 18:12:03 +08:00
yuangongji
d9c5978958 add MSGPACK_CXX_ONLY option to build c++ libraries only 2020-02-19 09:07:16 +08:00
yuangongji
19df3314f4 add coverage target in cmake 2020-01-11 13:23:19 +08:00
Takatoshi Kondo
3b2bb56243 Fixed #825.
Added verbose option to windows CIs.
Added C compiler flag operation for MSVC.
Fixed invalid /WX flag matching on MSVC at test.
2019-12-25 14:24:24 +09:00
Stefan Herbrechtsmeier
6046d5c666 cmake: Remove alias from package config
The cmake target of an alias may not be an Imported Target.
Always build the msgpackc target and only build the msgpackc-static
target if both should be build to fix issue #801. Thereby the type
(shared or static) of the msgpackc target depends on the build
configuration.
2019-09-20 22:10:40 +02:00
Takatoshi Kondo
fe2346efa1
Merge pull request #721 from dennisklein/master
Export an interface target for the C++ header-only library
2018-08-17 07:41:31 +09:00
Takatoshi Kondo
b804e12dec Fixed BUILD_SHARED_LIBS meaning.
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.
2018-08-15 16:39:21 +09:00
Dennis Klein
99c221ad01
Export an interface target for the C++ header-only library 2018-08-13 20:54:29 +02:00
Takatoshi Kondo
ac64fcace8 Added so version if shared object only build.
Fixed MSGPACK_INSTALLTARGETS list manipulation.
2018-08-10 19:39:43 +09:00
Takatoshi Kondo
3aaadb9b12 Fixed #703.
Added no build static-library option.
2018-08-08 20:14:48 +09:00
Takatoshi Kondo
ddb320197a
Merge pull request #689 from derwolfe/san-2
Sanitizer build for fuzzers
2018-05-21 19:25:30 +09:00
Chris Wolfe
dc51f6493b add/modify cmake and travis to get the regression tests built with sanitizers 2018-05-19 10:59:59 -05:00
James McCoy
8701aeec30 Strip the build path from generated documentation
Since FULL_PATH_NAMES = YES, Doxygen includes the full build path to the
file in the documentation.  This is most prevalent in the <title>
attribute for a file.

Setting STRIP_FROM_PATH = ${CMAKE_CURRENT_SOURCE_DIR}/include means that
only the relevant portion of the path (that which the user would need to
use) is included.

--- a/msgpack_8h.html	2018-05-12 14:03:34.098715879 -0400
+++ b/msgpack_8h.html	2018-05-12 14:04:17.386349607 -0400
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>MessagePack for C: /home/jamessan/src/debian.org/pkg-vim/msgpack-c/include/msgpack.h File Reference</title>
+<title>MessagePack for C: msgpack.h File Reference</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>
2018-05-12 14:04:48 -04:00
Takatoshi Kondo
347658cdc1 Updated the version to 3.0.0.
See https://github.com/msgpack/msgpack-c/pull/639#issuecomment-353786498
So I updated the version to 3.0.0.
In the version 2.x, it keeps the original behavior.
2018-04-08 22:27:45 +09:00
Takatoshi Kondo
423eaf25fb Removed -O3 -g -Werror options from CmakeLists.txt.
Added -g -Werror options to .travis.yml.
2018-04-04 13:07:21 +09:00
Emmanuel Lepage Vallée
579212996f
build: Do not set -g, -O3 and -Werror CFLAGS
Hello, here are a few changes to the default CFLAGS

## Why Werror

With each new compiler version, your code "break" and fail to compile. It is true that it's a sometime a "bug" in the code and need visibility to get fixed. However, Werror should *always* be a local CFLAGS and not a project one, see Google for endless people arguing back and forth and removing Werror is now the prevalent winner of that argument. In the latest GCC, it fails to compile because the fwrite result in unchecked. Even if you fix this in new releases, you cannot fix the past and all existing releases used in stable products suddenly fail to compile, wasting everybody time.

## Why -g

This should be decided by the one who compiles the code. Some people want small and pre-stripped binaries and appending this to the CFLAGS breaks the standard way of achieving this. Prepend it if you wish, but please do not append it.

## Why -O3

On many systems with limited cache or higher memory latency, `O3` is slower than `O2`, so IMHO it should not be hardcoded. In my case I used `Os` and it's faster. The `O` value should be left to the system, not hardcoded.
2017-12-12 01:26:22 -05:00
Takatoshi Kondo
10be66712d Partially fixed #460.
If msgpack-c compiles on "sparc" platform, then define
MSGPACK_ZONE_ALIGN=8 macro.
It allocates 8byte (64bit) alignment memory on zone allocating.
2017-07-20 11:00:16 +09:00
Takatoshi Kondo
a502097fd0 Solved #597.
Added `std::optional` and `std::string_view` adaptors.
2017-06-13 18:22:48 +09:00
Léonard Gérard
6871a82af7 Do not convert file everytime it is configured 2017-05-22 21:57:21 -07:00
Stefan Herbrechtsmeier
0aaf95608f cmake: Make boost mandatory if MSGPACK_BOOST is ON
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2017-05-13 00:57:03 +02:00
Stefan Herbrechtsmeier
918e7edba4 cmake: Add Boost library link directory
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2017-05-13 00:56:19 +02:00
Stefan Herbrechtsmeier
3d82c2d651 Add cmake package config support
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>
2017-04-04 08:33:18 +02:00
Stefan Herbrechtsmeier
09e8833d53 Add boost include directories only if MSGPACK_BOOST is enabled
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-03-22 13:04:03 +01:00
Thomas Holder
a51f33c02f CMake <= 2.8.11 compatibility
Keep compatible with cmake <= 2.8.11 by using the legacy PATH alias for
DIRECTORY with get_filename_component.
2017-03-08 21:45:13 -05:00
Takatoshi Kondo
88032f37e1 Merge pull request #570 from lluixhi/boost
Enable building against dynamically-linked Boost
2017-03-05 13:02:14 +09:00
Aric Belsito
a6599e5fb4
Enable building against dynamically-linked Boost 2017-03-03 12:31:56 -08:00
Aric Belsito
791f55da35
Make header install obey MSGPACK_ENABLE_CXX 2017-03-03 12:25:55 -08:00
Takatoshi Kondo
c704d4bfab Added new example. 2017-01-09 16:18:35 +09:00
Takatoshi Kondo
4466bda819 Updated travis-ci.
Use container based build `sudo: false`.
2017-01-07 01:20:22 +09:00
Takatoshi Kondo
84ad9a2634 Added Spirit.X3 based parse.
It uses iterator pair instead of data and size.
2017-01-05 21:24:25 +09:00
Takatoshi Kondo
4ec0fdf207 Fixed #544.
Replaced -std=c++03 with -std=c++98.
2016-12-11 15:53:59 +09:00
Takatoshi Kondo
73af452ed8 Fixed #507.
Removed -Wno-mismatched-tags option from g++.
g++ doesn't support the option and doesn't care the mismatch originally.
2016-07-29 19:49:53 +09:00