diff options
| author | Phil Felton <39185762+philjdf@users.noreply.github.com> | 2019-07-25 01:50:17 +0100 |
|---|---|---|
| committer | dan-shaw <51385773+dan-shaw@users.noreply.github.com> | 2019-07-24 17:50:17 -0700 |
| commit | 8522c799ea5bdc1693958f47bbf828adf27433c7 (patch) | |
| tree | cf7bb4b1d38a8933d056c3375bd831904d12b164 | |
| parent | 8255ef352105d5f42e3d5e1a4e9e7beac3f4d5ff (diff) | |
| download | vcpkg-8522c799ea5bdc1693958f47bbf828adf27433c7.tar.gz vcpkg-8522c799ea5bdc1693958f47bbf828adf27433c7.zip | |
[Thrift] Make Thrift static again (#7302)
* Make thrift static
* Update CONTROL
* Thrift able to build statically and dynamically
* Clean up bin dir in static
* Changes as per discussion
* Remove comment
* Better comment
| -rw-r--r-- | ports/thrift/CONTROL | 2 | ||||
| -rw-r--r-- | ports/thrift/portfile.cmake | 24 |
2 files changed, 22 insertions, 4 deletions
diff --git a/ports/thrift/CONTROL b/ports/thrift/CONTROL index 2ee3ef03e..cfff0ac7e 100644 --- a/ports/thrift/CONTROL +++ b/ports/thrift/CONTROL @@ -1,5 +1,5 @@ Source: thrift -Version: 2019-05-07-2 +Version: 2019-05-07-3 Build-Depends: zlib, libevent, openssl, boost-range, boost-smart-ptr, boost-date-time, boost-locale, boost-scope-exit Homepage: https://github.com/apache/thrift Description: Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible. diff --git a/ports/thrift/portfile.cmake b/ports/thrift/portfile.cmake index c7fd84003..5c5a76e9f 100644 --- a/ports/thrift/portfile.cmake +++ b/ports/thrift/portfile.cmake @@ -1,5 +1,10 @@ include(vcpkg_common_functions) +# 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 +# it looks like it will be supported in v0.13. vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_find_acquire_program(FLEX) @@ -13,11 +18,15 @@ vcpkg_from_github( HEAD_REF master ) +# 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. vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA NO_CHARSET_FLAG OPTIONS + -DWITH_SHARED_LIB=off + -DWITH_STATIC_LIB=on -DWITH_STDTHREADS=ON -DBUILD_TESTING=off -DBUILD_JAVA=off @@ -38,14 +47,23 @@ file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/th # 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*") +file(GLOB COMPILER "${CURRENT_PACKAGES_DIR}/bin/thrift" "${CURRENT_PACKAGES_DIR}/bin/thrift.exe") if(COMPILER) file(COPY ${COMPILER} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/thrift) file(REMOVE ${COMPILER}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/thrift) endif() +file(GLOB COMPILERD "${CURRENT_PACKAGES_DIR}/debug/bin/thrift" "${CURRENT_PACKAGES_DIR}/debug/bin/thrift.exe") +if(COMPILERD) + file(REMOVE ${COMPILERD}) +endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + +if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +endif() + vcpkg_copy_pdbs() |
