[boost-hana] Increase boost-hana default enum count to reasonable size (#52184)

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
This commit is contained in:
Tim Paine 2026-08-17 14:12:49 -04:00 committed by GitHub
parent 94a5411977
commit 11618d8420
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 66 additions and 2 deletions

View File

@ -8,8 +8,28 @@ vcpkg_from_github(
HEAD_REF master
)
if("large-struct-macros" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS)
set(BOOST_HANA_MAX_NUMBER_OF_MEMBERS 124)
else()
set(BOOST_HANA_MAX_NUMBER_OF_MEMBERS 200)
endif()
math(EXPR BOOST_HANA_GENERATOR_LIMIT "${BOOST_HANA_MAX_NUMBER_OF_MEMBERS} + 1")
vcpkg_find_acquire_program(RUBY)
vcpkg_execute_required_process(
COMMAND "${RUBY}" -rerb -e "ENV['MAX_NUMBER_OF_MEMBERS'] = ARGV[0]; print ERB.new(File.read(ARGV[1])).result" "${BOOST_HANA_GENERATOR_LIMIT}" "${SOURCE_PATH}/include/boost/hana/detail/struct_macros.hpp.erb"
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "boost-hana-generate-struct-macros"
OUTPUT_VARIABLE _boost_hana_struct_macros
)
file(WRITE "${SOURCE_PATH}/include/boost/hana/detail/struct_macros.hpp" "${_boost_hana_struct_macros}")
message(STATUS "boost-hana: generated struct_macros.hpp for up to ${BOOST_HANA_MAX_NUMBER_OF_MEMBERS} members")
endif()
set(FEATURE_OPTIONS "")
boost_configure_and_install(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/boost-hana/usage Normal file
View File

@ -0,0 +1,4 @@
boost-hana provides CMake targets:
find_package(Boost CONFIG REQUIRED COMPONENTS hana)
target_link_libraries(main PRIVATE Boost::hana)

View File

@ -2,6 +2,7 @@
"$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
"name": "boost-hana",
"version": "1.91.0",
"port-version": 1,
"description": "Boost hana module",
"homepage": "https://www.boost.org/library/latest/hana/",
"documentation": "https://www.boost.org/libs/hana",
@ -35,5 +36,11 @@
"name": "boost-tuple",
"version>=": "1.91.0"
}
]
],
"features": {
"large-struct-macros": {
"description": "Regenerate Boost.Hana struct macros for up to 200 members (124 on Windows)",
"supports": "windows | osx | (linux & x64)"
}
}
}

View File

@ -38,6 +38,7 @@ $semverVersion = ($version -replace '(\d+(\.\d+){1,3}).*', '$1')
$defaultPortVersion = 0
$portVersions = @{
'boost-cobalt' = 1
'boost-hana' = 1
}
function Get-PortVersion {
@ -133,6 +134,14 @@ $portData = @{
};
};
};
'boost-hana' = @{
'features' = @{
'large-struct-macros' = @{
'description' = 'Regenerate Boost.Hana struct macros for up to 200 members (124 on Windows)';
'supports' = 'windows | osx | (linux & x64)';
}
}
};
'boost-locale' = @{
'dependencies' = @(@{ 'name' = 'libiconv'; 'platform' = '!uwp & !windows & !mingw' });
'supports' = '!uwp';

View File

@ -0,0 +1 @@
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -0,0 +1,18 @@
if("large-struct-macros" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS)
set(BOOST_HANA_MAX_NUMBER_OF_MEMBERS 124)
else()
set(BOOST_HANA_MAX_NUMBER_OF_MEMBERS 200)
endif()
math(EXPR BOOST_HANA_GENERATOR_LIMIT "${BOOST_HANA_MAX_NUMBER_OF_MEMBERS} + 1")
vcpkg_find_acquire_program(RUBY)
vcpkg_execute_required_process(
COMMAND "${RUBY}" -rerb -e "ENV['MAX_NUMBER_OF_MEMBERS'] = ARGV[0]; print ERB.new(File.read(ARGV[1])).result" "${BOOST_HANA_GENERATOR_LIMIT}" "${SOURCE_PATH}/include/boost/hana/detail/struct_macros.hpp.erb"
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "boost-hana-generate-struct-macros"
OUTPUT_VARIABLE _boost_hana_struct_macros
)
file(WRITE "${SOURCE_PATH}/include/boost/hana/detail/struct_macros.hpp" "${_boost_hana_struct_macros}")
message(STATUS "boost-hana: generated struct_macros.hpp for up to ${BOOST_HANA_MAX_NUMBER_OF_MEMBERS} members")
endif()

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "52d28a00e03c5b86ae3faa2b4f40e6a16de1cbe2",
"version": "1.91.0",
"port-version": 1
},
{
"git-tree": "77335d8e473053357d8d5c331867a070605bc677",
"version": "1.91.0",

View File

@ -1038,7 +1038,7 @@
},
"boost-hana": {
"baseline": "1.91.0",
"port-version": 0
"port-version": 1
},
"boost-hash2": {
"baseline": "1.91.0",