Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions ports/glaze/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO stephenberry/glaze
REF "v${VERSION}"
SHA512 23ddfebd05cb54a81677dc314a2b21c74cc2d35c362262d99178ecd64067aac2cb0cee14b1cd91de4d45c6980758f80e218d1d5f7e3f15f0bf00583b675ef8de
SHA512 f19e001fd6025594eb546ed7993bab73b303b064bf9563148f172a9c6dbbba9e6de41997be5284ca148908a307fe282e67974489df68fca699b9fb25ce4e7af0
HEAD_REF main
PATCHES
support-win.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ssl glaze_ENABLE_SSL
interop glaze_BUILD_INTEROP
ssl glaze_ENABLE_SSL
)

vcpkg_cmake_configure(
Expand All @@ -26,6 +29,12 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
if("interop" IN_LIST FEATURES)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# interop produces shared library with static client library.
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't merge this with that policy turned on. Can you remove adding that feature? I assume it was not added originally for this exact reason.

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
45 changes: 45 additions & 0 deletions ports/glaze/support-win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

diff --git a/include/glaze/interop/interop.hpp b/include/glaze/interop/interop.hpp
index b6ef0c2..ebee37c 100644
--- a/include/glaze/interop/interop.hpp
+++ b/include/glaze/interop/interop.hpp
@@ -127,7 +127,7 @@ static_assert(sizeof(glz_string_desc) == 8, "glz_string_desc must be 8 bytes");
static_assert(sizeof(glz_complex_desc) == 8, "glz_complex_desc must be 8 bytes");

// Pointer sizes vary between 32-bit and 64-bit systems
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
// 64-bit system
static_assert(sizeof(glz_vector_desc) == 8, "glz_vector_desc must be 8 bytes on 64-bit");
static_assert(sizeof(glz_map_desc) == 16, "glz_map_desc must be 16 bytes on 64-bit");
@@ -144,7 +144,7 @@ static_assert(sizeof(glz_struct_desc) == 12, "glz_struct_desc must be 12 bytes o
static_assert(sizeof(glz_optional_desc) == 4, "glz_optional_desc must be 4 bytes on 32-bit");
static_assert(sizeof(glz_function_desc) == 20, "glz_function_desc must be 20 bytes on 32-bit");
static_assert(sizeof(glz_shared_future_desc) == 4, "glz_shared_future_desc must be 4 bytes on 32-bit");
-static_assert(sizeof(glz_variant_desc) == 20, "glz_variant_desc must be 20 bytes on 32-bit");
+static_assert(sizeof(glz_variant_desc) == 24, "glz_variant_desc must be 24 bytes on 32-bit");
#endif

// The variant-like type descriptor - properly aligned
@@ -167,10 +167,10 @@ struct glz_type_descriptor
};

// Verify the overall type descriptor size
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
static_assert(sizeof(glz_type_descriptor) == 40, "glz_type_descriptor must be 40 bytes on 64-bit");
#else
-static_assert(sizeof(glz_type_descriptor) == 28, "glz_type_descriptor must be 28 bytes on 32-bit");
+static_assert(sizeof(glz_type_descriptor) == 32, "glz_type_descriptor must be 32 bytes on 32-bit");
#endif

namespace glz
@@ -1311,7 +1311,7 @@ struct glz_unordered_map
};

// Static assertions for the C structs
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
// 64-bit system
static_assert(sizeof(glz_member_info) == 48, "glz_member_info must be 48 bytes on 64-bit");
static_assert(sizeof(glz_type_info) == 32, "glz_type_info must be 32 bytes on 64-bit");
5 changes: 4 additions & 1 deletion ports/glaze/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "glaze",
"version": "5.5.5",
"version": "5.6.1",
"description": "One of the fastest JSON libraries in the world. Glaze reads and writes from C++ memory, simplifying interfaces and offering incredible performance.",
"homepage": "https://github.com/stephenberry/glaze",
"license": "MIT",
Expand All @@ -16,6 +16,9 @@
}
],
"features": {
"interop": {
"description": "Build language interoperability library"
},
"ssl": {
"description": "Enable SSL/TLS support for HTTPS servers",
"dependencies": [
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci.feature.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ geotrans = skip # Port geotrans source ftp://ftp.nga.mil server extremely slow m
getopt:arm-uwp=fail
getopt:x64-uwp=fail
gflags(uwp)=fail
# glaze requires gcc12 and clang15 or later. linux-x64 always fails because it uses gcc11.
glaze[interop]:x64-linux=feature-fails
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# glaze requires gcc12 and clang15 or later. linux-x64 always fails because it uses gcc11.
glaze[interop]:x64-linux=feature-fails

Not necessary now that the interop feature has been removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vicroms
Thank you a lot!
I forget it.
Fixed.

glfw3(uwp)=fail
glibmm:x64-windows-static-md=fail
glibmm:x64-windows-static=fail
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3293,7 +3293,7 @@
"port-version": 0
},
"glaze": {
"baseline": "5.5.5",
"baseline": "5.6.1",
"port-version": 0
},
"glbinding": {
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/glaze.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eb3fa5ce2e202e868fbb2b0c019d9145bad3c45f",
"version": "5.6.1",
"port-version": 0
},
{
"git-tree": "028b117eb99342226cf002284e1fde7687857803",
"version": "5.5.5",
Expand Down