vcpkg/ports/fbthrift/portfile.cmake
Billy O'Neal 6647a76be8
[fbthrift, fizz, folly, mvfst] Fix dependency resolution. (#23124)
* [fbthrift, fizz, folly] Fix dependency resolution.

Found by nightly build https://dev.azure.com/vcpkg/public/_build/results?buildId=67402

* wangle was fixed by a compiler update on a patch tuesday.
* this unblocked attempting fbthrift on x64-windows hosts, but it misses a header; added patch already merged upstream adding missing algorithm <include>
* fixed folly attempt to insert the right debug prefix which was broken by vcpkg_fixup_cmake_targets no longer generating _IMPORT_PREFIX.
* disable dynamic build of fbthrift on Windows because it tries to create DLLs with no import libs (because it makes no exports)

* Format and fix version database.

* Back out fizz patches.

* Block dynamic flavors. (The build in question builds an exe and expects all its dependencies to be linked statically and patching the build system to copy over the right DLLs seems out of scope)

* Add libevent patch.

* Also fixup mvfst and add missing CONFIG to patch.

* Remove unused patch.

* Fix version sha
2022-02-16 19:56:04 -08:00

54 lines
2.3 KiB
CMake

vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(BISON)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/fbthrift
REF v2022.01.31.00
SHA512 159457398fdc0c89c34364b8a89068127c3519ce35af349776016e0ae37ae9508689853e0e371c2065fd715451f466e37c7e3799e054eca02cbc4717809150ab
HEAD_REF master
PATCHES
add-missing-algorithm-include.patch # https://github.com/facebook/fbthrift/commit/f2151fa730058a1baf23ed3dc082c91df6351da1
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DBISON_EXECUTABLE=${BISON}"
"-DFLEX_EXECUTABLE=${FLEX}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/fbthrift)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# There should be no empty directories in vcpkg/packages/fbthrift_x64-linux
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/transport/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp/util/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/server/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/common/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/http2/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/core/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/transport/inmemory/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/protocol/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/security/extensions/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/security/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/frozen/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/reflection/docs"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/util/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/cpp2/visitation/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/py3/test"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/py3/benchmark"
"${CURRENT_PACKAGES_DIR}/include/thrift/lib/thrift/annotation"
)
vcpkg_copy_tools(TOOL_NAMES thrift1 AUTO_CLEAN)
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)