[aws-sdk-cpp] Remove compute_build_only.cmake. (#34384)

This commit is contained in:
Theodore Tsirpanis 2023-10-13 06:11:35 +03:00 committed by GitHub
parent 2f94f0e5a6
commit 19db77b44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 228 additions and 1325 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,85 +1,73 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$SourcesRef,
[Parameter(Mandatory=$false)][string]$PortDirectory = $PSScriptRoot,
[Parameter(Mandatory=$false)][string]$vcpkg = "$PSScriptRoot/../../vcpkg"
)
$ErrorActionPreference = "Stop"
$ManifestIn = "$PortDirectory/vcpkg.in.json"
$ManifestOut = "$PortDirectory/vcpkg.json"
$CMakeFragmentFile = "$PortDirectory/compute_build_only.cmake"
$ExtractedSources = "${env:TEMP}/aws-sdk-cpp-generateFeatures-$SourcesRef"
if (-not (Test-Path $ExtractedSources)) {
if (Test-Path "$ExtractedSources.tmp") {
Remove-Item -Force "$ExtractedSources.tmp"
}
git clone "https://github.com/aws/aws-sdk-cpp" "$ExtractedSources.tmp" | Out-Host
git -c "$ExtractedSources.tmp" checkout $SourcesRef
Move-Item "$ExtractedSources.tmp" "$ExtractedSources"
}
Write-Host "Using sources directory: $ExtractedSources"
$subfolders = Get-ChildItem -Path "$ExtractedSources\generated\src\aws-cpp-sdk-*", "$ExtractedSources\src\aws-cpp-sdk*" | Sort-Object -Property Name
$manifest = Get-Content $ManifestIn | ConvertFrom-Json
$manifest | Add-Member `
-NotePropertyName '$note' `
-NotePropertyValue 'Automatically generated by generateFeatures.ps1'
$manifest | Add-Member -NotePropertyName 'features' -NotePropertyValue @{}
$cmakefragmenttext = @("# Automatically generated by generateFeatures.ps1")
function GetDescription($dir, $modulename)
{
if (Test-Path "$dir\CMakeLists.txt")
{
$descs = @(Select-String -Path "$dir\CMakeLists.txt" -Pattern "`"C\+\+ SDK for the AWS [^`"]*`"")
if ($descs.count -eq 1) {
$desc = $descs[0].Matches.Value -replace "`"",""
"$desc"
}
else { "C++ SDK for the AWS $modulename service" }
}
else { "C++ SDK for the AWS $modulename service" }
}
$featureDependencies = @{}
Select-String -Path "$ExtractedSources\cmake\sdksCommon.cmake" -Pattern "list\(APPEND SDK_DEPENDENCY_LIST `"([\w-]+):([\w-,]+)`"\)" -AllMatches `
| ForEach-Object { $_.Matches } `
| ForEach-Object { $featureDependencies[$_.Groups[1].Value] = @($_.Groups[2].Value -split "," `
| Where-Object { $_ -ne "core" }) }
foreach ($subfolder in $subfolders)
{
$modulename = $subfolder.name -replace "^aws-cpp-sdk-",""
if ($modulename -match "-tests`$") { continue }
if ($modulename -match "-sample`$") { continue }
if ($modulename -eq "core") { continue }
$lowermodulename = $modulename.ToLower()
$featureObj = @{ description = (GetDescription $subfolder $modulename) }
if ($featureDependencies.ContainsKey($lowermodulename)) {
$featureObj.dependencies = ,@{ name = "aws-sdk-cpp"; "default-features" = $false; "features" = $featureDependencies[$lowermodulename] }
}
$manifest.features.Add("$lowermodulename", $featureObj)
$cmakefragmenttext += @(
"if(`"$lowermodulename`" IN_LIST FEATURES)",
" list(APPEND BUILD_ONLY $modulename)",
"endif()"
)
}
[IO.File]::WriteAllText($ManifestOut, (ConvertTo-Json -Depth 10 -InputObject $manifest))
Write-Verbose ($cmakefragmenttext -join "`n")
[IO.File]::WriteAllText($CMakeFragmentFile, ($cmakefragmenttext -join "`n") +"`n")
& $vcpkg format-manifest --feature-flags=-manifests $ManifestOut
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$SourcesRef,
[Parameter(Mandatory=$false)][string]$PortDirectory = $PSScriptRoot,
[Parameter(Mandatory=$false)][string]$vcpkg = "$PSScriptRoot/../../vcpkg"
)
$ErrorActionPreference = "Stop"
$ManifestIn = "$PortDirectory/vcpkg.in.json"
$ManifestOut = "$PortDirectory/vcpkg.json"
$ExtractedSources = "${env:TEMP}/aws-sdk-cpp-generateFeatures-$SourcesRef"
if (-not (Test-Path $ExtractedSources)) {
if (Test-Path "$ExtractedSources.tmp") {
Remove-Item -Force "$ExtractedSources.tmp"
}
git clone "https://github.com/aws/aws-sdk-cpp" "$ExtractedSources.tmp" | Out-Host
git -c "$ExtractedSources.tmp" checkout $SourcesRef
Move-Item "$ExtractedSources.tmp" "$ExtractedSources"
}
Write-Host "Using sources directory: $ExtractedSources"
$subfolders = Get-ChildItem -Path "$ExtractedSources\generated\src\aws-cpp-sdk-*", "$ExtractedSources\src\aws-cpp-sdk*" | Sort-Object -Property Name
$manifest = Get-Content $ManifestIn | ConvertFrom-Json
$manifest | Add-Member `
-NotePropertyName '$note' `
-NotePropertyValue 'Automatically generated by generateFeatures.ps1'
$manifest | Add-Member -NotePropertyName 'features' -NotePropertyValue @{}
function GetDescription($dir, $modulename)
{
if (Test-Path "$dir\CMakeLists.txt")
{
$descs = @(Select-String -Path "$dir\CMakeLists.txt" -Pattern "`"C\+\+ SDK for the AWS [^`"]*`"")
if ($descs.count -eq 1) {
$desc = $descs[0].Matches.Value -replace "`"",""
"$desc"
}
else { "C++ SDK for the AWS $modulename service" }
}
else { "C++ SDK for the AWS $modulename service" }
}
$featureDependencies = @{}
Select-String -Path "$ExtractedSources\cmake\sdksCommon.cmake" -Pattern "list\(APPEND SDK_DEPENDENCY_LIST `"([\w-]+):([\w-,]+)`"\)" -AllMatches `
| ForEach-Object { $_.Matches } `
| ForEach-Object { $featureDependencies[$_.Groups[1].Value] = @($_.Groups[2].Value -split "," `
| Where-Object { $_ -ne "core" }) }
foreach ($subfolder in $subfolders)
{
$modulename = $subfolder.name -replace "^aws-cpp-sdk-",""
if ($modulename -match "-tests`$") { continue }
if ($modulename -match "-sample`$") { continue }
if ($modulename -eq "core") { continue }
$lowermodulename = $modulename.ToLower()
$featureObj = @{ description = (GetDescription $subfolder $modulename) }
if ($featureDependencies.ContainsKey($lowermodulename)) {
$featureObj.dependencies = ,@{ name = "aws-sdk-cpp"; "default-features" = $false; "features" = $featureDependencies[$lowermodulename] }
}
$manifest.features.Add("$lowermodulename", $featureObj)
}
[IO.File]::WriteAllText($ManifestOut, (ConvertTo-Json -Depth 10 -InputObject $manifest))
& $vcpkg format-manifest --feature-flags=-manifests $ManifestOut

View File

@ -1,101 +1,99 @@
vcpkg_buildpath_length_warning(37)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aws/aws-sdk-cpp
REF "${VERSION}"
vcpkg_buildpath_length_warning(37)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aws/aws-sdk-cpp
REF "${VERSION}"
SHA512 63de900870e9bec23d42e9458e0e9b1579a9e2dc7b0f404eae1b0dd406898b6d6841c5e2f498710b3828f212705437da3a2fe94813a6c3a842945100a05ae368
PATCHES
patch-relocatable-rpath.patch
fix-aws-root.patch
lock-curl-http-and-tls-settings.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
set(EXTRA_ARGS)
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
set(rpath "@loader_path")
elseif (VCPKG_TARGET_IS_ANDROID)
set(EXTRA_ARGS "-DTARGET_ARCH=ANDROID"
"-DGIT_EXECUTABLE=--invalid-git-executable--"
"-DGIT_FOUND=TRUE"
"-DNDK_DIR=$ENV{ANDROID_NDK_HOME}"
"-DANDROID_BUILD_ZLIB=FALSE"
"-DANDROID_BUILD_CURL=FALSE"
"-DANDROID_BUILD_OPENSSL=FALSE"
)
else()
set(rpath "\$ORIGIN")
endif()
set(BUILD_ONLY core)
include(${CMAKE_CURRENT_LIST_DIR}/compute_build_only.cmake)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${EXTRA_ARGS}
"-DENABLE_UNITY_BUILD=ON"
"-DENABLE_TESTING=OFF"
"-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT}"
"-DBUILD_ONLY=${BUILD_ONLY}"
"-DBUILD_DEPS=OFF"
"-DBUILD_SHARED_LIBS=OFF"
"-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF"
"-DCMAKE_INSTALL_RPATH=${rpath}"
"-DCMAKE_MODULE_PATH=${CURRENT_INSTALLED_DIR}/share/aws-c-common" # use extra cmake files
)
vcpkg_cmake_install()
foreach(TARGET IN LISTS BUILD_ONLY)
vcpkg_cmake_config_fixup(PACKAGE_NAME "aws-cpp-sdk-${TARGET}" CONFIG_PATH "lib/cmake/aws-cpp-sdk-${TARGET}" DO_NOT_DELETE_PARENT_CONFIG_PATH)
endforeach()
vcpkg_cmake_config_fixup(PACKAGE_NAME "AWSSDK" CONFIG_PATH "lib/cmake/AWSSDK")
vcpkg_copy_pdbs()
file(GLOB_RECURSE AWS_TARGETS "${CURRENT_PACKAGES_DIR}/share/*/*-targets-*.cmake")
foreach(AWS_TARGET IN LISTS AWS_TARGETS)
file(READ ${AWS_TARGET} _contents)
string(REGEX REPLACE
"bin\\/([A-Za-z0-9_.-]+\\.lib)"
"lib/\\1"
_contents "${_contents}")
file(WRITE ${AWS_TARGET} "${_contents}")
endforeach()
file(GLOB AWS_CONFIGS "${CURRENT_PACKAGES_DIR}/share/*/aws-cpp-sdk-*-config.cmake")
list(FILTER AWS_CONFIGS EXCLUDE REGEX "aws-cpp-sdk-core-config\\.cmake\$")
foreach(AWS_CONFIG IN LISTS AWS_CONFIGS)
file(READ "${AWS_CONFIG}" _contents)
file(WRITE "${AWS_CONFIG}" "include(CMakeFindDependencyMacro)\nfind_dependency(aws-cpp-sdk-core)\n${_contents}")
endforeach()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/lib/pkgconfig"
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig"
"${CURRENT_PACKAGES_DIR}/nuget"
"${CURRENT_PACKAGES_DIR}/debug/nuget"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib)
if(LIB_FILES)
file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(REMOVE ${LIB_FILES})
endif()
file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib)
if(DEBUG_LIB_FILES)
file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(REMOVE ${DEBUG_LIB_FILES})
endif()
file(APPEND "${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h" "#ifndef USE_IMPORT_EXPORT\n#define USE_IMPORT_EXPORT\n#endif")
endif()
configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
PATCHES
patch-relocatable-rpath.patch
fix-aws-root.patch
lock-curl-http-and-tls-settings.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
set(EXTRA_ARGS)
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
set(rpath "@loader_path")
elseif (VCPKG_TARGET_IS_ANDROID)
set(EXTRA_ARGS "-DTARGET_ARCH=ANDROID"
"-DGIT_EXECUTABLE=--invalid-git-executable--"
"-DGIT_FOUND=TRUE"
"-DNDK_DIR=$ENV{ANDROID_NDK_HOME}"
"-DANDROID_BUILD_ZLIB=FALSE"
"-DANDROID_BUILD_CURL=FALSE"
"-DANDROID_BUILD_OPENSSL=FALSE"
)
else()
set(rpath "\$ORIGIN")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${EXTRA_ARGS}
"-DENABLE_UNITY_BUILD=ON"
"-DENABLE_TESTING=OFF"
"-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT}"
"-DBUILD_ONLY=${FEATURES}"
"-DBUILD_DEPS=OFF"
"-DBUILD_SHARED_LIBS=OFF"
"-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF"
"-DCMAKE_INSTALL_RPATH=${rpath}"
"-DCMAKE_MODULE_PATH=${CURRENT_INSTALLED_DIR}/share/aws-c-common" # use extra cmake files
)
vcpkg_cmake_install()
foreach(TARGET IN LISTS FEATURES)
vcpkg_cmake_config_fixup(PACKAGE_NAME "aws-cpp-sdk-${TARGET}" CONFIG_PATH "lib/cmake/aws-cpp-sdk-${TARGET}" DO_NOT_DELETE_PARENT_CONFIG_PATH)
endforeach()
vcpkg_cmake_config_fixup(PACKAGE_NAME "AWSSDK" CONFIG_PATH "lib/cmake/AWSSDK")
vcpkg_copy_pdbs()
file(GLOB_RECURSE AWS_TARGETS "${CURRENT_PACKAGES_DIR}/share/*/*-targets-*.cmake")
foreach(AWS_TARGET IN LISTS AWS_TARGETS)
file(READ ${AWS_TARGET} _contents)
string(REGEX REPLACE
"bin\\/([A-Za-z0-9_.-]+\\.lib)"
"lib/\\1"
_contents "${_contents}")
file(WRITE ${AWS_TARGET} "${_contents}")
endforeach()
file(GLOB AWS_CONFIGS "${CURRENT_PACKAGES_DIR}/share/*/aws-cpp-sdk-*-config.cmake")
list(FILTER AWS_CONFIGS EXCLUDE REGEX "aws-cpp-sdk-core-config\\.cmake\$")
foreach(AWS_CONFIG IN LISTS AWS_CONFIGS)
file(READ "${AWS_CONFIG}" _contents)
file(WRITE "${AWS_CONFIG}" "include(CMakeFindDependencyMacro)\nfind_dependency(aws-cpp-sdk-core)\n${_contents}")
endforeach()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/lib/pkgconfig"
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig"
"${CURRENT_PACKAGES_DIR}/nuget"
"${CURRENT_PACKAGES_DIR}/debug/nuget"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib)
if(LIB_FILES)
file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(REMOVE ${LIB_FILES})
endif()
file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib)
if(DEBUG_LIB_FILES)
file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(REMOVE ${DEBUG_LIB_FILES})
endif()
file(APPEND "${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h" "#ifndef USE_IMPORT_EXPORT\n#define USE_IMPORT_EXPORT\n#endif")
endif()
configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,12 +1,12 @@
The package @PORT@:@TARGET_TRIPLET@ provides CMake targets:
When using AWSSDK, AWSSDK_ROOT_DIR must be defined by the user.
find_package(AWSSDK CONFIG COMPONENTS core dynamodb kinesis s3 REQUIRED)
target_include_directories(main PRIVATE ${AWSSDK_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${AWSSDK_LIBRARIES})
OR
find_package(aws-cpp-sdk-core REQUIRED)
target_include_directories(main PRIVATE aws-cpp-sdk-core)
target_link_libraries(main PRIVATE aws-cpp-sdk-core)
The package @PORT@:@TARGET_TRIPLET@ provides CMake targets:
When using AWSSDK, AWSSDK_ROOT_DIR must be defined by the user.
find_package(AWSSDK CONFIG COMPONENTS core dynamodb kinesis s3 REQUIRED)
target_include_directories(main PRIVATE ${AWSSDK_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${AWSSDK_LIBRARIES})
OR
find_package(aws-cpp-sdk-core REQUIRED)
target_include_directories(main PRIVATE aws-cpp-sdk-core)
target_link_libraries(main PRIVATE aws-cpp-sdk-core)

View File

@ -1,37 +1,38 @@
{
"name": "aws-sdk-cpp",
"version": "1.11.160",
"description": "AWS SDK for C++",
"homepage": "https://github.com/aws/aws-sdk-cpp",
"license": "Apache-2.0",
"supports": "!(windows & arm) & !uwp",
"dependencies": [
"aws-crt-cpp",
{
"name": "curl",
"default-features": false,
"features": [
"ssl"
],
"platform": "!uwp & !windows"
},
{
"name": "openssl",
"platform": "!uwp & !windows"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
"dynamodb",
"kinesis",
"s3"
]
}
{
"name": "aws-sdk-cpp",
"version": "1.11.160",
"port-version": 1,
"description": "AWS SDK for C++",
"homepage": "https://github.com/aws/aws-sdk-cpp",
"license": "Apache-2.0",
"supports": "!(windows & arm) & !uwp",
"dependencies": [
"aws-crt-cpp",
{
"name": "curl",
"default-features": false,
"features": [
"ssl"
],
"platform": "!uwp & !windows"
},
{
"name": "openssl",
"platform": "!uwp & !windows"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"default-features": [
"dynamodb",
"kinesis",
"s3"
]
}

View File

@ -2,6 +2,7 @@
"$note": "Automatically generated by generateFeatures.ps1",
"name": "aws-sdk-cpp",
"version": "1.11.169",
"port-version": 1,
"description": "AWS SDK for C++",
"homepage": "https://github.com/aws/aws-sdk-cpp",
"license": "Apache-2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5c0ad10a852e7facc0cea54e3990f16e0cb1ea8b",
"version": "1.11.169",
"port-version": 1
},
{
"git-tree": "714b1b2815e2a3f57c79c8703a9cdc9892240acd",
"version": "1.11.169",

View File

@ -402,7 +402,7 @@
},
"aws-sdk-cpp": {
"baseline": "1.11.169",
"port-version": 0
"port-version": 1
},
"azmq": {
"baseline": "2023-03-23",