mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 16:56:17 +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"
|
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows-msvc-conan:
|
|
||||||
runs-on: windows-latest
|
|
||||||
windows-msvc:
|
windows-msvc:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
+3
-11
@@ -58,8 +58,6 @@ else()
|
|||||||
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra>)
|
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# target_compile_features(reflectcpp PUBLIC cxx_std_20)
|
|
||||||
|
|
||||||
set(REFLECT_CPP_SOURCES
|
set(REFLECT_CPP_SOURCES
|
||||||
src/reflectcpp.cpp
|
src/reflectcpp.cpp
|
||||||
)
|
)
|
||||||
@@ -147,12 +145,9 @@ if (REFLECTCPP_TOML)
|
|||||||
src/reflectcpp_toml.cpp
|
src/reflectcpp_toml.cpp
|
||||||
)
|
)
|
||||||
if(REFLECTCPP_USE_VCPKG)
|
if(REFLECTCPP_USE_VCPKG)
|
||||||
target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
find_package(PkgConfig REQUIRED)
|
||||||
if (MSVC)
|
pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus)
|
||||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/tomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
target_link_libraries(reflectcpp PUBLIC PkgConfig::tomlplusplus)
|
||||||
else ()
|
|
||||||
target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libtomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
||||||
endif ()
|
|
||||||
else()
|
else()
|
||||||
find_package(tomlplusplus)
|
find_package(tomlplusplus)
|
||||||
target_link_libraries(reflectcpp PUBLIC tomlplusplus::tomlplusplus)
|
target_link_libraries(reflectcpp PUBLIC tomlplusplus::tomlplusplus)
|
||||||
@@ -163,9 +158,6 @@ if (REFLECTCPP_UBJSON)
|
|||||||
list(APPEND REFLECT_CPP_SOURCES
|
list(APPEND REFLECT_CPP_SOURCES
|
||||||
src/reflectcpp_ubjson.cpp
|
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)
|
find_package(jsoncons CONFIG REQUIRED)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|||||||
@@ -545,18 +545,7 @@ The following compilers are supported:
|
|||||||
|
|
||||||
### Using vcpkg
|
### Using vcpkg
|
||||||
|
|
||||||
```bash
|
https://vcpkg.io/en/package/reflectcpp
|
||||||
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.
|
|
||||||
|
|
||||||
### Using Conan
|
### 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
|
## Option 1: Using vcpkg
|
||||||
|
|
||||||
|
Refer to the following port:
|
||||||
|
|
||||||
|
https://vcpkg.io/en/package/reflectcpp
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vcpkg install reflectcpp
|
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_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(
|
target_link_libraries(
|
||||||
reflect-cpp-toml-tests
|
reflect-cpp-toml-tests
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ add_executable(
|
|||||||
)
|
)
|
||||||
target_precompile_headers(reflect-cpp-ubjson-tests PRIVATE [["rfl.hpp"]] <iostream> <string> <functional> <gtest/gtest.h>)
|
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(
|
target_link_libraries(
|
||||||
reflect-cpp-ubjson-tests
|
reflect-cpp-ubjson-tests
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
@@ -70,6 +70,10 @@
|
|||||||
{
|
{
|
||||||
"name": "vcpkg-cmake-config",
|
"name": "vcpkg-cmake-config",
|
||||||
"version>=": "2022-02-06#1"
|
"version>=": "2022-02-06#1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"vcpkg-pkgconfig-get-modules",
|
||||||
|
"version>=": "2024-04-03"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user