Reference to the reflect-cpp Conan package (#281)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-11-27 22:12:00 +01:00
committed by GitHub
parent cb06a085b8
commit 8af0e6ec77
3 changed files with 21 additions and 12 deletions
+7 -2
View File
@@ -6,6 +6,8 @@
[![Generic badge](https://img.shields.io/badge/gcc-11+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/gcc-11+-blue.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/clang-14+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/clang-14+-blue.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/MSVC-17+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/MSVC-17+-blue.svg)](https://shields.io/)
[![Conan Center](https://img.shields.io/conan/v/reflect-cpp)](https://conan.io/center/recipes/reflect-cpp)
**📖 Documentation**: https://rfl.getml.com — **👨‍💻 Source Code**: https://github.com/getml/reflect-cpp **📖 Documentation**: https://rfl.getml.com — **👨‍💻 Source Code**: https://github.com/getml/reflect-cpp
@@ -541,9 +543,13 @@ The following compilers are supported:
- Clang 14.0 or higher - Clang 14.0 or higher
- MSVC 17.8 (19.38) or higher - MSVC 17.8 (19.38) or higher
### Using Conan
https://conan.io/center/recipes/reflect-cpp
### Compilation using cmake ### Compilation using cmake
This will simply compile YYJSON, which is the JSON library underlying reflect-cpp. You can then include reflect-cpp in your project and link to the binary to get reflect-cpp with JSON support. This will compile reflect-cpp with JSON support only. You can then include reflect-cpp in your project and link to the binary.
```bash ```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@@ -555,7 +561,6 @@ If you need support for any other supported [serialization formats](#serializati
You can also [include the source files](https://rfl.getml.com/install/#option-1-include-source-files-into-your-own-build) into your build or compile it using [cmake and vcpkg.](https://rfl.getml.com/install/#option-3-compilation-using-cmake-and-vcpkg) For detailed installation instructions, please refer to the [install guide](https://rfl.getml.com/install). You can also [include the source files](https://rfl.getml.com/install/#option-1-include-source-files-into-your-own-build) into your build or compile it using [cmake and vcpkg.](https://rfl.getml.com/install/#option-3-compilation-using-cmake-and-vcpkg) For detailed installation instructions, please refer to the [install guide](https://rfl.getml.com/install).
## The team behind reflect-cpp ## The team behind reflect-cpp
reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributions coming from the community. reflect-cpp has been developed by [getML (Code17 GmbH)](https://getml.com), a company specializing in software engineering and machine learning for enterprise applications. reflect-cpp is currently maintained by Patrick Urbanke and Manuel Bellersen, with major contributions coming from the community.
+1
View File
@@ -16,6 +16,7 @@ hide:
[![Generic badge](https://img.shields.io/badge/gcc-11+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/gcc-11+-blue.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/clang-14+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/clang-14+-blue.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/MSVC-17+-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/MSVC-17+-blue.svg)](https://shields.io/)
[![Conan Center](https://img.shields.io/conan/v/reflect-cpp)](https://conan.io/center/recipes/reflect-cpp)
**📖 Documentation**: [https://rfl.getml.com](https://rfl.getml.com) — **👨‍💻 Source Code**: [https://github.com/getml/reflect-cpp](https://github.com/getml/reflect-cpp) **📖 Documentation**: [https://rfl.getml.com](https://rfl.getml.com) — **👨‍💻 Source Code**: [https://github.com/getml/reflect-cpp](https://github.com/getml/reflect-cpp)
+11 -8
View File
@@ -12,17 +12,13 @@ The following compilers are supported:
You can include the source files into your build or compile it using cmake and vcpkg. You can include the source files into your build or compile it using cmake and vcpkg.
## Option 1: Include source files into your own build ## Option 1: Using Conan
Simply copy the contents of the folders `include` and `src` into your source repository or add it to your include path and also add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp` and `src/yyjson.c` to your source files for compilation. Simply use the following [recipe](https://conan.io/center/recipes/reflect-cpp).
If you want to link to your own version of YYJSON, then only add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp`. If you don't need JSON support, then only add `src/reflectcpp.cpp`.
If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_<format>.cpp` and include and link the respective libraries, as listed in the section on serialization formats.
## Option 2: Compilation using cmake ## Option 2: Compilation using cmake
This will simply compile YYJSON, which is the JSON library underlying reflect-cpp. You can then include reflect-cpp in your project and link to the binary This will compile reflect-cpp with JSON support only. You can then include reflect-cpp in your project and link to the binary.
to get reflect-cpp with JSON support.
```bash ```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@@ -30,7 +26,14 @@ cmake --build build -j 4 # gcc, clang
cmake --build build --config Release -j 4 # MSVC cmake --build build --config Release -j 4 # MSVC
``` ```
## Option 3: Compilation using cmake and vcpkg ## Option 3: Include source files into your own build
Simply copy the contents of the folders `include` and `src` into your source repository or add it to your include path and also add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp` and `src/yyjson.c` to your source files for compilation.
If you want to link to your own version of YYJSON, then only add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp`. If you don't need JSON support, then only add `src/reflectcpp.cpp`.
If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_<format>.cpp` and include and link the respective libraries, as listed in the section on serialization formats.
## Option 4: Compilation using cmake and vcpkg
If you want serialization formats other than JSON, you can either install them manually or use vcpkg. If you want serialization formats other than JSON, you can either install them manually or use vcpkg.