[argtable3] Improve build system and remove unnecessary patches (#45789)

This commit is contained in:
Tom G. Huang 2025-06-03 15:26:17 -07:00 committed by GitHub
parent bbc7867887
commit f4690bfde5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 25 additions and 40 deletions

View File

@ -1,16 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8ea5334..1ec6bbe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -86,6 +86,11 @@ target_include_directories(argtable3 PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
+if(NOT ARGTABLE3_REPLACE_GETOPT)
+ find_package(unofficial-getopt-win32 REQUIRED)
+ target_link_libraries(argtable3 PRIVATE unofficial::getopt-win32::getopt)
+endif()
+
set_target_properties(argtable3 PROPERTIES
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
SOVERSION "${PROJECT_VERSION_MAJOR}"

View File

@ -1,16 +1,20 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO argtable/argtable3
REF "v${VERSION}"
SHA512 b434944f264d22e271415078b5bc6c80feb3ce508189f9b62ec292fa1c041de7cbeb6c2f4be7c59341cd189f346d8a52808b1676481fc29df92fbec12cb89b2a
HEAD_REF master
PATCHES Fix-dependence-getopt.patch
# We cannot use vcpkg_from_github to download the source archive because the
# auto-generated GitHub archive does not include the `version.tag` file. This
# file is required to generate argtable3.pc with the correct version info.
# To resolve this, we prepare the source archive manually and use
# vcpkg_download_distfile to download it.
vcpkg_download_distfile(
ARCHIVE
URLS "https://github.com/argtable/argtable3/releases/download/v${VERSION}/argtable-v${VERSION}.zip"
FILENAME "argtable-v${VERSION}.zip"
SHA512 5591d510a1c739148aa356e5fa9827e037c4a0f1d171453635fad0cca4030d1fa3cce1e50671a944d12abfd4793df1f5cd1125825a23c63e54e9362def56e9f9
)
set(ARGTABLE3_REPLACE_GETOPT ON)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
set(ARGTABLE3_REPLACE_GETOPT OFF)
endif()
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
@ -18,11 +22,10 @@ vcpkg_cmake_configure(
-DARGTABLE3_ENABLE_CONAN=OFF
-DARGTABLE3_ENABLE_TESTS=OFF
-DARGTABLE3_ENABLE_EXAMPLES=OFF
-DARGTABLE3_REPLACE_GETOPT=${ARGTABLE3_REPLACE_GETOPT}
)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
@ -31,8 +34,6 @@ elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}")
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,14 +1,11 @@
{
"name": "argtable3",
"version-string": "3.3.0.116da6c",
"port-version": 1,
"description": "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options",
"homepage": "https://www.argtable.org/",
"license": "BSD-2-Clause-NetBSD AND TCL",
"license": "BSD-3-Clause AND TCL",
"dependencies": [
{
"name": "getopt",
"platform": "windows & !mingw"
},
{
"name": "vcpkg-cmake",
"host": true

View File

@ -614,8 +614,6 @@ apsi[log4cplus,zeromq]:arm64-uwp = cascade
aravis(uwp) = cascade
arb:arm64-uwp = cascade
arb:x64-uwp = cascade
argtable3:arm64-uwp = cascade
argtable3:x64-uwp = cascade
arpack-ng:arm64-windows = cascade
arrayfire:x64-uwp = cascade
arrayfire[cuda]:x64-windows = cascade
@ -2093,7 +2091,7 @@ zyre:x64-uwp = cascade
ableton-link[hut](linux) = feature-fails # libportaudiocpp0 must be installed in ci. See https://github.com/microsoft/vcpkg/pull/32144
adios2[python](!uwp) = feature-fails # Could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy)
arrayfire[opencl](windows & !uwp) = feature-fails # build errror: See https://github.com/microsoft/vcpkg/issues/33464
ashes[core](windows) = combination-fails # CMake Error: INSTALL(EXPORT) given unknown export "AshesRenderers". One render backend must be selected
ashes[core](windows) = combination-fails # CMake Error: INSTALL(EXPORT) given unknown export "AshesRenderers". One render backend must be selected
azure-kinect-sensor-sdk[tool](windows & !uwp) = feature-fails # Waits for https://github.com/microsoft/vcpkg/pull/33231
# boost-python[core](!linux) = combination-fails
awlib[graphics] = feature-fails # Broken code. See https://github.com/microsoft/vcpkg/issues/39849

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0057e71075971fe4287766bf35b3cb3a3bc7ff01",
"version-string": "3.3.0.116da6c",
"port-version": 1
},
{
"git-tree": "b50840a1e4bb570697cad03f94145c0660b1e4ef",
"version-string": "3.3.0.116da6c",

View File

@ -234,7 +234,7 @@
},
"argtable3": {
"baseline": "3.3.0.116da6c",
"port-version": 0
"port-version": 1
},
"argumentum": {
"baseline": "0.3.2",