2576 Commits

Author SHA1 Message Date
Takatoshi Kondo
306d59d52f
Merge pull request #1152 from redboltz/update_codecov
Updated codecov.
2025-02-21 22:39:02 +09:00
Takatoshi Kondo
0299d94105 Fixed compile time constant issue. 2025-02-21 22:22:01 +09:00
Takatoshi Kondo
51528a4389 Updated codecov. 2025-02-21 22:15:53 +09:00
Takatoshi Kondo
445880108a
Merge pull request #1138 from redboltz/update_to_610c
Updated the version to 6.1.0 (C)
c-6.1.0
2024-08-17 18:28:44 +09:00
Takatoshi Kondo
b5af8ae8bc Updated the version to 6.1.0 (C) 2024-08-17 14:49:29 +09:00
Takatoshi Kondo
03551d31fd
Merge pull request #1137 from redboltz/Athishpranav2003-msgpack-object-kv
Athishpranav2003 msgpack object kv
2024-08-17 14:34:17 +09:00
Takatoshi Kondo
6f24d240e1 Supported all msgpack object types.
Fixed cmake warning.
2024-08-17 13:40:58 +09:00
Athish Pranav D
985184b647 Added tests for the Init functionality
Signed-off-by: Athish Pranav D <athishanna@gmail.com>
2024-08-17 08:51:23 +05:30
Athish Pranav D
96493f581d Nit
Signed-off-by: Athish Pranav D <athishanna@gmail.com>
2024-08-13 13:31:24 +05:30
Athish Pranav D
c1cb968c04 Add msgpack obj init for complex types
Signed-off-by: Athish Pranav D <athishanna@gmail.com>
2024-08-13 13:27:17 +05:30
Takatoshi Kondo
eba6304a3a
Merge pull request #1129 from redboltz/update_c_602
Updated the version to 6.0.2 (C)
c-6.0.2
2024-06-24 15:56:53 +09:00
Takatoshi Kondo
ef0927a6f0 Updated the version to 6.0.2 (C) 2024-06-24 15:30:56 +09:00
Takatoshi Kondo
bf2504e7bb
Merge pull request #1125 from otegami/fix-ignored-includedir
Fix header file installation to respect `CMAKE_INSTALL_INCLUDEDIR`
2024-06-24 15:28:45 +09:00
otegami
724d1aad39 Fix header file installation paths to respect CMAKE_INSTALL_INCLUDEDIR
Previously, header files were installed uniformly under the include directory, ignoring the specified paths.
This change ensures header files are installed in the appropriate directories under `CMAKE_INSTALL_INCLUDEDIR`.
2024-06-12 20:22:02 +08:00
Takatoshi Kondo
a5c8a2c845
Merge pull request #1121 from otegami/support-absolute-path-for-pkg-config
Support absolute path for CMAKE_INSTALL_*DIR
2024-05-14 16:01:23 +09:00
otegami
4e027b72de Support absolute path for CMAKE_INSTALL_*DIR
Issue

When `CMAKE_INSTALL_LIBDIR` and `CMAKE_INSTALL_INCLUDEDIR` are set to absolute paths, the `msgpack-c.pc` file generated by CMake improperly configures `libdir` and `includedir`. This leads to incorrect paths that prevent the compiler from locating necessary header and library files.

How to reproduce

Build and install `msgpack-c`.

```console
% cmake -S . -B ../msgpack-c.build -DCMAKE_INSTALL_LIBDIR=/tmp/local/lib -DCMAKE_INSTALL_INCLUDEDIR=/tmp/local/include
% cmake --build ../msgpack-c.build
% sudo cmake --install ../msgpack-c.build
```

Compile `example/simple_c.c` using installed msgpack-c. The following error happens because the linker cannot find paths provided by pkg-config.

```console
% export PKG_CONFIG_PATH=/tmp/local/lib/pkgconfig:$PKG_CONFIG_PATH
% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
/usr/bin/ld: cannot find -lmsgpack-c: No such file or directory
collect2: error: ld returned 1 exit status
```

Expected

Successfully compile `example/simple_c.c` using installed msgpack-c. We can execute `simple_c` like the following.

```console
% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
% ./simple_c
93 01 c3 a7 65 78 61 6d 70 6c 65
[1, true, "example"]
```

Explain the problem in detail

The generated `msgpack-c.pc` file does not handle absolute paths correctly. Here is the result of the incorrect configuration in `How to reproduce` section. In the following `msgpack-c.pc` file, `libdir` and `includedir` are showing unrecognized paths, leading to incorrect paths.

```console
% cat /tmp/local/lib/pkgconfig/msgpack-c.pc
prefix=/usr/local
exec_prefix=/usr/local
libdir=${prefix}//tmp/local/lib <- Here the path is wrong. We expected `/tmp/local/lib`
includedir=${prefix}//tmp/local/include <- Here the path is wrong. We expected `/tmp/local/include`

Name: MessagePack
Description: Binary-based efficient object serialization library
Version: 6.0.1
Libs: -L${libdir} -lmsgpack-c
Cflags: -I${includedir}
```

Solution

Modify the `CMakeLists.txt` file to ensure that `libdir` and `includedir` use absolute paths. This change addresses the issue by providing correct paths to the compiler and linker.
2024-05-12 21:38:35 +08:00
Takatoshi Kondo
c31fafbcd1
Merge pull request #1119 from otegami/support-relative-path-for-pkg-config
Support relative path for CMAKE_INSTALL_*DIR
2024-04-26 13:34:22 +09:00
otegami
68cc50a3de Support relative path for CMAKE_INSTALL_*DIR
When `CMAKE_INSTALL_LIBDIR` and `CMAKE_INSTALL_INCLUDEDIR` are set to relative paths, the `msgpack-c.pc` file generated by CMake improperly configures `libdir` and `includedir`. This leads to incorrect paths that prevent the compiler from locating necessary header and library files.

Build and install `msgpack-c`.

```console
% git switch -c c_master
% cmake -S . -B ../msgpack-c.build -DCMAKE_INSTALL_PREFIX=/tmp/local -DCMAKE_INSTALL_LIBDIR=lib-relative -DCMAKE_INSTALL_INCLUDEDIR=include-relative
% cmake --build ../msgpack-c.build
% cmake --install ../msgpack-c.build/
```

Compile `example/simple_c.c` using installed msgpack-c.
The following error happens because the linker cannot find paths provided by pkg-config.

```console
% export PKG_CONFIG_PATH=/usr/local/lib-relative/pkgconfig:$PKG_CONFIG_PATH
% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
/usr/bin/ld: cannot find -lmsgpack-c: No such file or directory
collect2: error: ld returned 1 exit status
```

Successly compile `example/simple_c.c` using install msgpack-c.
We can execute `simple_c.c` like the following.

```console
% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
% ./simple_c
93 01 c3 a7 65 78 61 6d 70 6c 65
[1, true, "example"]
```

The generated `msgpack-c.pc` file does not handle relative paths correctly. Here is the result of the incorrect configuration in How to reproduce section.
In the following `msgpack-c.pc` file, `libdir` and `includedir` are relative to the current directory, leading to incorrect paths.

```console
cat ../msgpack-c.build/msgpack-c.pc
prefix=/tmp/local
exec_prefix=/tmp/local
libdir=lib-relative
includedir=include-relative

Name: MessagePack
Description: Binary-based efficient object serialization library
Version: 6.0.1
Libs: -L${libdir} -lmsgpack-c
Cflags: -I${includedir}
```

Modify the `msgpack-c.pc.in` file to ensure that `libdir` and `includedir` use absolute paths by prefixing them with ${prefix}/. This change addresses the issue by providing correct paths to the compiler and linker.
2024-04-26 12:21:26 +08:00
Takatoshi Kondo
9f37918bb5
Merge pull request #1120 from redboltz/fix_osx_ci
Removed invalid ctest option `r`.
2024-04-26 13:02:40 +09:00
Takatoshi Kondo
b8b54a2fef Updated gtest install methond on macos. 2024-04-26 12:29:23 +09:00
Takatoshi Kondo
f2c1991ede Removed invalid ctest option r. 2024-04-26 12:19:06 +09:00
Takatoshi Kondo
5ab83b10b4
Merge pull request #1114 from redboltz/update_to_601_c
Update the version to 6.0.1.
c-6.0.1
2024-04-02 13:33:35 +09:00
Takatoshi Kondo
9785991158 Update the version to 6.0.1. 2024-04-02 12:29:17 +09:00
Takatoshi Kondo
68d085aa45
Merge pull request #1108 from Zopolis4/gnuinstalldirt
Use GNUInstallDirs to set installation directories
2024-03-07 19:32:11 +09:00
Zopolis4
d1af4a3cdb
Use GNUInstallDirs to set installation directories 2024-03-07 17:57:01 +11:00
Takatoshi Kondo
5f287d1361
Merge pull request #1109 from Zopolis4/appveyedc
Fix appveyor for c_master
2024-03-07 15:53:56 +09:00
Zopolis4
76d768c5a4
Update zlib to 1.3.1 in appveyor.yml 2024-03-07 15:08:41 +11:00
Takatoshi Kondo
37744bd6a8
Merge pull request #1097 from dundargoc/cmake-version
Bump minimum cmake version to 3.5 to avoid deprecation warning
2023-11-09 19:25:10 +09:00
dundargoc
8957d6ec07 Bump minimum cmake version to 3.5 to avoid deprecation warning
Building msgpack gives currently gives the following warning:
"CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions."

Reuse same solution as fc18087cdfaadec0b905643f93950387e797da08 as the
policy CMP0060 introduced in cmake 3.3 causes problems with when linking
for 32-bit otherwise.
2023-10-23 20:51:18 +02:00
Takatoshi Kondo
3a41b24ff2
Merge pull request #1091 from redboltz/update_zlib_for_ci_c
Updated zlib for CI.
2023-08-30 00:00:35 +09:00
Takatoshi Kondo
d03a9b91f3 Updated zlib for CI. 2023-08-29 23:31:35 +09:00
Takatoshi Kondo
366f06d4ac
Merge pull request #1069 from redboltz/fix_1066
Fix #1066.
2023-05-10 13:08:09 +09:00
Takatoshi Kondo
fe4312c427 Fix #1066. 2023-05-10 12:19:20 +09:00
Takatoshi Kondo
cd67366b7f
Merge pull request #1060 from ericvw/cmake-respect-prefx-at-install
cmake: Respect --prefix for headers during cmake --install
2023-04-14 18:19:57 +09:00
Eric N. Vander Weele
80f60009f5 cmake: Respect --prefix for headers during cmake --install
Removing CMAKE_INSTALL_PREFIX allows for `cmake --install <build-dir>
--prefix=<installation-prefix>` to install headers at
`<installation-prefix>/include` at install time.

When CMAKE_INSTALL_PREFIX is present in `INSTALL()`, it is hard-coded
during configuration (e.g., `cmake -S .`), which disallows it from being
set at install time.
2023-04-12 09:22:22 -04:00
Takatoshi Kondo
4fd5056ea5
Merge pull request #1061 from ericvw/ci-linux-ubuntu-latest
ci: Use ubuntu-latest for CI on Linux
2023-04-12 12:03:25 +09:00
Eric N. Vander Weele
7fc51afd59 ci: Use ubuntu-latest for CI on Linux
Ubuntu 18.04 is deprecated on GitHub Actions. Additionally:

- Install 'clang' to get the latest clang toolchain.
    - Use -gdwarf-4 so Valgrind understands the debug information.
- Install latest version of gtest (v1.13.0).
- Show compile and link commands when building.
- `cat` Valgrind output on error.
2023-04-11 15:39:50 -04:00
Takatoshi Kondo
8160ede5e2 Update README.md. c-6.0.0 2023-03-04 22:43:04 +09:00
Takatoshi Kondo
6e8503f1c0
Merge pull request #1055 from dundargoc/build/only-c
Explicitly specify the project is a C project if tests aren't used.
2023-03-04 22:39:01 +09:00
dundargoc
2f543923d2 Explicitly specify the project is a C project.
CMake assumes the default project uses both C and C++, and therefore
will fail if both a C and a C++ compiler isn't found. This essentially
blocks pure C projects from using msgpack-c if they also don't have a
C++ compiler.

Just specifying that the project is "C" isn't possible though, as the
test themselves use C++. The workaround here is that we specify the
project needs both a C and C++ compiler if tests are used, but only a C
compiler if the tests aren't used.
2023-03-04 13:41:42 +01:00
Takatoshi Kondo
b3de6f83cb
Merge pull request #1053 from redboltz/unify_project_name_c
Unify all package related names to msgpack-c.
2023-03-04 21:35:08 +09:00
Takatoshi Kondo
01f3d24fee Unify all package related names to msgpack-c.
Update the version to 6.0.0.
2023-02-28 10:49:13 +09:00
Takatoshi Kondo
551308ae10
Merge pull request #1049 from redboltz/fix_makedist.sh
Fixed cmake config name.
c-5.0.0
2023-01-10 21:41:34 +09:00
Takatoshi Kondo
f2c446799c Fixed cmake config name. 2023-01-10 20:06:01 +09:00
Takatoshi Kondo
c2430635f9
Merge pull request #1047 from redboltz/update_to_500_c
Updated the version to 5.0.0.
2023-01-10 19:58:15 +09:00
Takatoshi Kondo
bffd3f2091 Updated the version to 5.0.0. 2023-01-10 18:50:20 +09:00
Takatoshi Kondo
076b5ed7fd
Merge pull request #1044 from traversaro/patch-1
Change CMake package name of C library to msgpackc
2023-01-10 18:32:20 +09:00
Silvio Traversaro
52fa74804c
Update CMakeLists.txt 2023-01-10 10:02:33 +01:00
Silvio Traversaro
5ae6077234
Update appveyor.yml 2023-01-07 14:40:24 +01:00
Silvio Traversaro
43de525dc7
Update zlib used in AppVeyor to 1.2.13 2023-01-07 13:35:33 +01:00