mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-02 16:16:19 +08:00
Reference to the reflect-cpp Conan package (#281)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
[](https://shields.io/)
|
||||
[](https://shields.io/)
|
||||
[](https://shields.io/)
|
||||
[](https://conan.io/center/recipes/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
|
||||
- MSVC 17.8 (19.38) or higher
|
||||
|
||||
### Using Conan
|
||||
|
||||
https://conan.io/center/recipes/reflect-cpp
|
||||
|
||||
### 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
|
||||
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).
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ hide:
|
||||
[](https://shields.io/)
|
||||
[](https://shields.io/)
|
||||
[](https://shields.io/)
|
||||
[](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)
|
||||
|
||||
@@ -83,4 +84,4 @@ For comprehensive C++ support beyond the scope of GitHub discussions, we’re he
|
||||
|
||||
|
||||
## License
|
||||
reflect-cpp is released under the MIT License.
|
||||
reflect-cpp is released under the MIT License.
|
||||
|
||||
+12
-9
@@ -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.
|
||||
|
||||
## 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.
|
||||
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.
|
||||
Simply use the following [recipe](https://conan.io/center/recipes/reflect-cpp).
|
||||
|
||||
## 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
|
||||
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
|
||||
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
|
||||
```
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -68,4 +71,4 @@ vcpkg is a great, but very ambitious and complex project (just like C++ is a gre
|
||||
|
||||
2. *Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, ppc64le and riscv platforms.* - This usually happens on arm platforms like the Apple Silicon chips and can be resolved by simply preceding your build with `export VCPKG_FORCE_SYSTEM_BINARIES=arm` or `export VCPKG_FORCE_SYSTEM_BINARIES=1`.
|
||||
|
||||
3. On some occasions you might be asked to specify a compiler. You can do so by simply adding it to the cmake command as follows: `cmake -S . -B build ... -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++` or `cmake -S . -B build ... -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17` (or whatever supported compiler you would like to use).
|
||||
3. On some occasions you might be asked to specify a compiler. You can do so by simply adding it to the cmake command as follows: `cmake -S . -B build ... -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++` or `cmake -S . -B build ... -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17` (or whatever supported compiler you would like to use).
|
||||
|
||||
Reference in New Issue
Block a user