mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-02 16:16:19 +08:00
Use pkg-config for the TOML package (#291)
This commit is contained in:
@@ -6,8 +6,6 @@ env:
|
||||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
||||
|
||||
jobs:
|
||||
windows-msvc-conan:
|
||||
runs-on: windows-latest
|
||||
windows-msvc:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
|
||||
+3
-11
@@ -58,8 +58,6 @@ else()
|
||||
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra>)
|
||||
endif()
|
||||
|
||||
# target_compile_features(reflectcpp PUBLIC cxx_std_20)
|
||||
|
||||
set(REFLECT_CPP_SOURCES
|
||||
src/reflectcpp.cpp
|
||||
)
|
||||
@@ -147,12 +145,9 @@ if (REFLECTCPP_TOML)
|
||||
src/reflectcpp_toml.cpp
|
||||
)
|
||||
if(REFLECTCPP_USE_VCPKG)
|
||||
target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
if (MSVC)
|
||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/tomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
else ()
|
||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libtomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif ()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus)
|
||||
target_link_libraries(reflectcpp PUBLIC PkgConfig::tomlplusplus)
|
||||
else()
|
||||
find_package(tomlplusplus)
|
||||
target_link_libraries(reflectcpp PUBLIC tomlplusplus::tomlplusplus)
|
||||
@@ -163,9 +158,6 @@ if (REFLECTCPP_UBJSON)
|
||||
list(APPEND REFLECT_CPP_SOURCES
|
||||
src/reflectcpp_ubjson.cpp
|
||||
)
|
||||
if(REFLECTCPP_USE_VCPKG)
|
||||
target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
endif()
|
||||
find_package(jsoncons CONFIG REQUIRED)
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -545,18 +545,7 @@ The following compilers are supported:
|
||||
|
||||
### Using vcpkg
|
||||
|
||||
```bash
|
||||
vcpkg install reflectcpp
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```bash
|
||||
vcpkg add port reflectcpp
|
||||
```
|
||||
|
||||
If the library cannot be found, please update vcpkg itself and/or update the `builtin-baseline`
|
||||
tag in the *vcpkg.json* of your project.
|
||||
https://vcpkg.io/en/package/reflectcpp
|
||||
|
||||
### Using Conan
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@ You can include the source files into your build or compile it using cmake and v
|
||||
|
||||
## Option 1: Using vcpkg
|
||||
|
||||
Refer to the following port:
|
||||
|
||||
https://vcpkg.io/en/package/reflectcpp
|
||||
|
||||
```bash
|
||||
vcpkg install reflectcpp
|
||||
```
|
||||
|
||||
@@ -8,8 +8,6 @@ add_executable(
|
||||
)
|
||||
target_precompile_headers(reflect-cpp-toml-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
target_include_directories(reflect-cpp-toml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-toml-tests
|
||||
PRIVATE
|
||||
|
||||
@@ -8,8 +8,6 @@ add_executable(
|
||||
)
|
||||
target_precompile_headers(reflect-cpp-ubjson-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
||||
|
||||
target_include_directories(reflect-cpp-ubjson-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
|
||||
target_link_libraries(
|
||||
reflect-cpp-ubjson-tests
|
||||
PRIVATE
|
||||
|
||||
@@ -70,6 +70,10 @@
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"version>=": "2022-02-06#1"
|
||||
},
|
||||
{
|
||||
"name":"vcpkg-pkgconfig-get-modules",
|
||||
"version>=": "2024-04-03"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user