vcpkg/ports/thrift/portfile.cmake

59 lines
2.1 KiB
CMake
Raw Normal View History

2017-05-25 04:00:07 +08:00
include(vcpkg_common_functions)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported. Building static.") # See note below
set(VCPKG_LIBRARY_LINKAGE static)
# As per Ben Craig thrift comment see https://issues.apache.org/jira/browse/THRIFT-1834
# Currently, Thrift is designed to be packaged as a static library. As a static library, the consuming program / dll will only pull in the object files that it needs, so the per-binary size increase should be pretty small.
# Thrift isn't a very good candidate to become a dynamic library. No attempts are made to preserve binary compatibility, or to provide a C / COM-like interface to make binary compatibility easy.
endif()
2017-05-26 04:07:35 +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
2019-04-04 05:43:56 +08:00
REF 7b94dd422117ffb6c646d1217c643efb80a8cf45
SHA512 56b1810031b26ccc921cc39a2511fbee9af165c618b5ecb72d8f3dbdf9ae1d05b8adfe59e6f7ece8be837ca69a58e279997dd76c93e28c96607f18e2badcfbd1
2017-05-25 04:00:07 +08:00
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWITH_SHARED_LIB=OFF
-DWITH_STATIC_LIB=ON
-DWITH_STDTHREADS=ON
-DBUILD_TESTING=off
-DBUILD_JAVA=off
-DBUILD_C_GLIB=off
-DBUILD_PYTHON=off
-DBUILD_CPP=on
-DBUILD_HASKELL=off
-DBUILD_TUTORIALS=off
-DFLEX_EXECUTABLE=${FLEX}
-DBISON_EXECUTABLE=${BISON}
2017-05-25 04:00:07 +08:00
)
2017-05-25 05:27:24 +08:00
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/thrift RENAME copyright)
2019-04-04 05:43:56 +08:00
# Move CMake config files to the right place
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/thrift")
file(GLOB COMPILER "${CURRENT_PACKAGES_DIR}/bin/thrift*")
if(COMPILER)
file(COPY ${COMPILER} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/thrift)
file(REMOVE ${COMPILER})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/thrift)
2017-05-25 05:27:24 +08:00
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
vcpkg_copy_pdbs()