2019-09-27 05:31:55 +08:00
|
|
|
vcpkg_buildpath_length_warning(37)
|
2019-03-27 17:40:19 +08:00
|
|
|
|
2019-01-25 07:53:13 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO aws/aws-sdk-cpp
|
2021-09-15 10:06:34 +08:00
|
|
|
REF b0204a7b6a33211f533a175e987a755f714bf7f3 # 1.9.96
|
|
|
|
SHA512 456d3fc256a5a26843ecf16014242514b165ae5fa35f088d57aa54a744d19e2c38bd0bed9b6a4b76948c8a49cf87a06a4c722be5a910ed41dfd9c9b9a66b398d
|
2020-12-03 05:05:52 +08:00
|
|
|
PATCHES
|
2021-11-26 17:20:02 +08:00
|
|
|
fix-config.patch
|
2020-12-03 05:05:52 +08:00
|
|
|
patch-relocatable-rpath.patch
|
2021-11-09 13:03:08 +08:00
|
|
|
fix-aws-root.patch
|
2019-01-25 07:53:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
|
|
|
|
|
2021-04-20 08:08:51 +08:00
|
|
|
set(EXTRA_ARGS)
|
2020-11-17 02:26:18 +08:00
|
|
|
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
|
|
|
|
set(rpath "@loader_path")
|
2021-04-20 08:08:51 +08:00
|
|
|
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"
|
|
|
|
)
|
2020-11-17 02:26:18 +08:00
|
|
|
else()
|
|
|
|
set(rpath "\$ORIGIN")
|
|
|
|
endif()
|
2019-01-25 07:53:13 +08:00
|
|
|
|
2021-09-15 10:06:34 +08:00
|
|
|
set(BUILD_ONLY core)
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/compute_build_only.cmake)
|
2021-09-21 01:01:46 +08:00
|
|
|
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"
|
|
|
|
"-DCMAKE_INSTALL_RPATH=${rpath}"
|
|
|
|
"-DCMAKE_MODULE_PATH=${CURRENT_INSTALLED_DIR}/share/aws-c-common" # use extra cmake files
|
|
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
2019-01-25 07:53:13 +08:00
|
|
|
|
2021-09-15 10:06:34 +08:00
|
|
|
foreach(TARGET IN LISTS BUILD_ONLY)
|
2021-09-21 01:01:46 +08:00
|
|
|
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()
|
2019-01-25 07:53:13 +08:00
|
|
|
|
|
|
|
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
|
2021-09-15 10:06:34 +08:00
|
|
|
"${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"
|
2019-01-25 07:53:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
2021-09-17 01:35:18 +08:00
|
|
|
file(APPEND "${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h" "#ifndef USE_IMPORT_EXPORT\n#define USE_IMPORT_EXPORT\n#endif")
|
2019-01-25 07:53:13 +08:00
|
|
|
endif()
|
|
|
|
|
2021-09-17 01:35:18 +08:00
|
|
|
configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
|
2020-12-03 05:05:52 +08:00
|
|
|
|
2021-09-15 10:06:34 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|