2019-07-25 08:50:17 +08:00
|
|
|
# We currently insist on static only because:
|
|
|
|
# - Thrift doesn't yet support building as a DLL on Windows,
|
|
|
|
# - x64-linux only builds static anyway.
|
|
|
|
# From https://github.com/apache/thrift/blob/master/CHANGES.md
|
2022-05-21 05:35:37 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
endif()
|
2017-05-26 04:07:35 +08:00
|
|
|
|
2017-05-26 09:08:19 +08:00
|
|
|
vcpkg_find_acquire_program(FLEX)
|
|
|
|
vcpkg_find_acquire_program(BISON)
|
2017-05-25 04:00:07 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO apache/thrift
|
2023-09-14 07:38:54 +08:00
|
|
|
REF "${VERSION}"
|
|
|
|
SHA512 f9bfaf149dde4da1f5353e540b862c2088465115564d981bf02cd89e8c1f84ca53143ca0091b63d24f8f515425d9163af52ec6122245b59810a2b98292a71650
|
2017-05-25 04:00:07 +08:00
|
|
|
HEAD_REF master
|
2019-10-03 15:08:59 +08:00
|
|
|
PATCHES
|
|
|
|
"correct-paths.patch"
|
2022-05-21 05:35:37 +08:00
|
|
|
"pc-suffix.patch"
|
2017-05-25 04:00:07 +08:00
|
|
|
)
|
|
|
|
|
2020-06-18 04:42:40 +08:00
|
|
|
if (VCPKG_TARGET_IS_OSX)
|
|
|
|
message(WARNING "${PORT} requires bison version greater than 2.5,\n\
|
|
|
|
please use command \`brew install bison\` to install bison")
|
|
|
|
endif()
|
|
|
|
|
2022-05-21 05:35:37 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" shared_lib)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" static_lib)
|
|
|
|
|
2019-07-25 08:50:17 +08:00
|
|
|
# note we specify values for WITH_STATIC_LIB and WITH_SHARED_LIB because even though
|
|
|
|
# they're marked as deprecated, Thrift incorrectly hard-codes a value for BUILD_SHARED_LIBS.
|
2022-05-21 05:35:37 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-07-01 00:31:22 +08:00
|
|
|
NO_CHARSET_FLAG
|
2017-05-28 19:46:21 +08:00
|
|
|
OPTIONS
|
2022-05-21 05:35:37 +08:00
|
|
|
--trace-expand
|
|
|
|
-DLIB_INSTALL_DIR:PATH=lib
|
|
|
|
-DWITH_SHARED_LIB=${shared_lib}
|
|
|
|
-DWITH_STATIC_LIB=${static_lib}
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DBUILD_JAVA=OFF
|
|
|
|
-DWITH_C_GLIB=OFF
|
|
|
|
-DBUILD_C_GLIB=OFF
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GLIB=TRUE
|
|
|
|
-DBUILD_PYTHON=OFF
|
|
|
|
-DBUILD_CPP=ON
|
|
|
|
-DWITH_CPP=ON
|
|
|
|
-DWITH_ZLIB=ON
|
2023-04-28 03:15:15 +08:00
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=TRUE
|
2022-05-21 05:35:37 +08:00
|
|
|
-DWITH_LIBEVENT=ON
|
2023-04-28 03:15:15 +08:00
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_Libevent=TRUE
|
2022-05-21 05:35:37 +08:00
|
|
|
-DWITH_OPENSSL=ON
|
2023-04-28 03:15:15 +08:00
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=TRUE
|
2022-05-21 05:35:37 +08:00
|
|
|
-DBUILD_TUTORIALS=OFF
|
2017-05-28 19:46:21 +08:00
|
|
|
-DFLEX_EXECUTABLE=${FLEX}
|
2022-05-21 05:35:37 +08:00
|
|
|
-DWITH_QT5=OFF
|
2019-06-15 04:09:38 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=TRUE
|
2022-05-21 05:35:37 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Gradle=TRUE
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Java=TRUE
|
|
|
|
-DBUILD_JAVASCRIPT=OFF
|
|
|
|
-DBUILD_NODEJS=OFF
|
2017-05-28 19:46:21 +08:00
|
|
|
-DBISON_EXECUTABLE=${BISON}
|
2022-05-21 05:35:37 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_GLIB
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_Gradle
|
2023-04-28 03:15:15 +08:00
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_Libevent
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_ZLIB
|
2022-05-21 05:35:37 +08:00
|
|
|
|
2017-05-25 04:00:07 +08:00
|
|
|
)
|
|
|
|
|
2022-05-21 05:35:37 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-05-25 05:27:24 +08:00
|
|
|
|
2020-06-18 04:42:40 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-05-25 05:27:24 +08:00
|
|
|
|
2019-04-04 05:43:56 +08:00
|
|
|
# Move CMake config files to the right place
|
2022-05-21 05:35:37 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-04-04 05:43:56 +08:00
|
|
|
|
2019-07-25 08:50:17 +08:00
|
|
|
file(GLOB COMPILER "${CURRENT_PACKAGES_DIR}/bin/thrift" "${CURRENT_PACKAGES_DIR}/bin/thrift.exe")
|
2018-08-29 16:15:48 +08:00
|
|
|
if(COMPILER)
|
2022-05-21 05:35:37 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES thrift AUTO_CLEAN)
|
2017-05-25 05:27:24 +08:00
|
|
|
endif()
|
|
|
|
|
2023-09-14 07:38:54 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-07-25 08:50:17 +08:00
|
|
|
|
|
|
|
if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
|
2022-05-21 05:35:37 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
2019-07-25 08:50:17 +08:00
|
|
|
endif()
|
|
|
|
|
2023-04-28 03:15:15 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|