Skip to content

Commit

Permalink
[tomlplusplus] Update to 3.3.0 (microsoft#33835)
Browse files Browse the repository at this point in the history
* [tomlplusplus] update to 3.3.0

* update version

* fix android error

* update version

* update patch

* update version
  • Loading branch information
LilyWangLL authored Sep 26, 2023
1 parent a7d99a5 commit 4a31145
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
17 changes: 17 additions & 0 deletions ports/tomlplusplus/fix-android-fileapi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/include/toml++/impl/parser.inl b/include/toml++/impl/parser.inl
index 27de2b0..bb2fb46 100644
--- a/include/toml++/impl/parser.inl
+++ b/include/toml++/impl/parser.inl
@@ -23,6 +23,12 @@
#include "unicode.h"
TOML_DISABLE_WARNINGS;
#include <istream>
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 24
+ // Cf. https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md#32_bit-and
+ #define ftello ftell
+ #define fseeko fseek
+#endif
#include <fstream>
#if TOML_INT_CHARCONV || TOML_FLOAT_CHARCONV
#include <charconv>
16 changes: 7 additions & 9 deletions ports/tomlplusplus/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO marzer/tomlplusplus
REF v3.1.0
SHA512 b5223fa978b606f6b14fa74495884ccd491fa6017ef44b2ac9a384fa1df7100745145163e2a139255927fb51e5ecd779ee2643c19579eab6e4533b15e75c9be9
REF "v${VERSION}"
SHA512 6ab2de83b7fc44de40e58a47c28a9507bf7c50fa9b08925b5a6d48958868a86e6790aff684d29ceb50ad18905e3832840719e1b7bfec3b8a0c00b15bb0f70f38
HEAD_REF master
PATCHES
fix-android-fileapi.patch
)

vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dgenerate_cmake_config=true
-Dgenerate_cmake_config=false
-Dbuild_tests=false
-Dbuild_examples=false
)

vcpkg_install_meson()
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/tomlplusplus)
cmake_path(NATIVE_PATH SOURCE_PATH native_source_path)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/tomlplusplus/tomlplusplusConfig.cmake" "${native_source_path}" "")
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
5 changes: 5 additions & 0 deletions ports/tomlplusplus/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package tomlplusplus can be imported via CMake FindPkgConfig module:

find_package(PkgConfig REQUIRED)
pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus)
target_link_libraries(main PkgConfig::tomlplusplus)
6 changes: 1 addition & 5 deletions ports/tomlplusplus/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"name": "tomlplusplus",
"version": "3.1.0",
"version": "3.3.0",
"description": "Header-only TOML config file parser and serializer for modern C++.",
"homepage": "https://marzer.github.io/tomlplusplus/",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-tool-meson",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8329,7 +8329,7 @@
"port-version": 0
},
"tomlplusplus": {
"baseline": "3.1.0",
"baseline": "3.3.0",
"port-version": 0
},
"torch-th": {
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tomlplusplus.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e5d2f60be4fafc9cf2f8a9fbf5b69c8001e7f461",
"version": "3.3.0",
"port-version": 0
},
{
"git-tree": "bf80fe2b73187c7a5ae1ea2d32cba894c13f7224",
"version": "3.1.0",
Expand Down

0 comments on commit 4a31145

Please sign in to comment.