Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grpc/protobuf] Update grpc to 1.60.0 and update protobuf to 3.25.1 #35781

Merged
merged 46 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
059b2a0
grpc: Update to 1.60.0. Update protobuf, upb and utf8-range to 3.25.1
Tradias Dec 19, 2023
05a0c37
protobuf: Fix dll macro and add patches for libprotobuf-mutator. Also…
Tradias Dec 20, 2023
48e51a2
protobuf: Fix tool installation for non-windows
Tradias Dec 20, 2023
1daa78e
grpc: Fix pluginTargets.cmake. Also update gz-transport12 and patch o…
Tradias Dec 21, 2023
0b60e1b
protobuf: Fix several dependent packages after major version update a…
Tradias Dec 22, 2023
f848e98
protobuf: Fix dependent ignition-transport, gamenetworkingsockets and…
Tradias Dec 24, 2023
cf2801b
protobuf: Update and patch brpc and shogun. Simplify paraview protobu…
Tradias Jan 8, 2024
c9cdfae
protobuf: Update arcus. Fix libprotobuf-mutator protobuf patch
Tradias Jan 8, 2024
3bed1e5
protobuf: Adjust braft, libtorch, osgearth and pulsar-client-cpp to p…
Tradias Jan 19, 2024
50ea872
srpc: Adjust baseline version
Tradias Jan 19, 2024
eb32f57
libprotobuf-mutator: Fix msvc static runtime
Tradias Jan 20, 2024
2a7e2dd
protobuf: Adjust osgearth and paraview patches
Tradias Jan 24, 2024
e727f63
srpc: Update to 0.10.1 and fix protobuf linkage
Tradias Jan 25, 2024
2f90739
protobuf: Adjust removal of unused language backends and fix srpc get…
Tradias Jan 30, 2024
544f34d
protobuf: Fix depend cld3 library. Adjust srpc crt linkage. Remove du…
Tradias Jan 30, 2024
024220f
protobuf: Fix dependency propagation through cmake config file in bra…
Tradias Jan 31, 2024
3e23c1c
protobuf: Fix cld3, brpc, ecal and srpc osx builds
Tradias Feb 2, 2024
9aaf9ee
protobuf: Fix ecal and srpc patches
Tradias Feb 8, 2024
62fe5bc
mysql-connector-cpp: Add protobuf patch
Tradias Feb 9, 2024
a8c6358
marble: Patch accidental dependency on protobuf
Tradias Feb 13, 2024
a78b65b
protobuf: Change patches of several ports from find_package(protobuf …
Tradias Mar 1, 2024
ee9b972
protobuf: Patch mysql-connector-cpp and clean up openvino patch
Tradias Mar 5, 2024
7bbb939
glog: FIx braft and brpc after update
Tradias Mar 5, 2024
ecbdcad
protobuf: Attempt to fix mysql-connector-cpp protobuf executable not …
Tradias Mar 6, 2024
84c5053
protobuf: Fix mysql-connector-cpp when using protobuf with zlib feature
Tradias Mar 11, 2024
a27f01f
protobuf: Fix braft patch. Re-add port-version to marble. Fix ZLIB in…
Tradias Mar 12, 2024
70f976d
protobuf: Adjust mysql-connector-cpp patch to properly work with zlib…
Tradias Mar 16, 2024
fcba37d
brpc: Patch out #warning because OSX compiles with -Werror
Tradias Mar 17, 2024
506ca8b
cld3: Bump port version
Tradias Mar 21, 2024
0065778
grpc: Add patch for abseil 20240116.1
Tradias Mar 22, 2024
d8a32ca
abseil: Fix version in abseil_dll.pc
Tradias Apr 4, 2024
f3b1661
shogun: Remove unneeded patches
Tradias Apr 13, 2024
cdddfd2
abseil: Revert abseil back to 20240116.1 and add patch to fix openvin…
Tradias Apr 18, 2024
cabd5da
libprotobuf-mutator: Update to 1.3
Tradias Apr 26, 2024
dba071c
protobuf: Adjust version to 4.25.1 and reduce upb patch
Tradias Apr 27, 2024
94bd825
paraview: Bump port-version
Tradias May 7, 2024
e56d40d
shogun: Remove bitsery and restore its ci.baseline
Tradias May 19, 2024
8cd9334
protobuf: Update versions file
Tradias May 26, 2024
89660d4
protobuf: Include CONFIG in vcpkg-cmake-wrapper
Tradias Jun 5, 2024
445e091
protobuf: Fix find version in arcus and cartographer
Tradias Jun 6, 2024
832b11a
cartographer: Fix absolute path issue and disable compilation of test…
Tradias Jun 6, 2024
043f156
brpc/pulsar-cpp-client: Patch warnings caused by abseil dynamic_annot…
Tradias Jun 11, 2024
286f6fd
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Jun 14, 2024
73dd53a
Merge branch 'master' into grpc-1-60-0
Tradias Jun 19, 2024
69da939
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Jun 20, 2024
d2604eb
[protobuf] Skip unchanged vcpkg_replace_string.
BillyONeal Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,313 changes: 1,313 additions & 0 deletions ports/abseil/0001-revert-integer-to-string-conversion-optimizations.patch

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ports/abseil/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ vcpkg_from_github(
REF "${VERSION}"
SHA512 5062e731ee8c9a757e6d75fc1c558652deb4dd1daab4d6143f7ad52a139501c61365f89acbf82480be0f9a4911a58286560068d8b1a8b6774e6afad51739766e
HEAD_REF master
PATCHES
0001-revert-integer-to-string-conversion-optimizations.patch # Fix openvino MSVC compile error
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
1 change: 1 addition & 0 deletions ports/abseil/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "abseil",
"version": "20240116.2",
"port-version": 1,
"description": [
"Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.",
"In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.",
Expand Down
37 changes: 37 additions & 0 deletions ports/arcus/0002-protobuf-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/ArcusConfig.cmake.in b/ArcusConfig.cmake.in
index 3208a69..fb4a968 100644
--- a/ArcusConfig.cmake.in
+++ b/ArcusConfig.cmake.in
@@ -4,7 +4,7 @@
# However, if ProtobufConfig is used instead, there is a CMake option that controls
# this, which defaults to OFF. We need to force this option to ON instead.
set(protobuf_MODULE_COMPATIBLE ON CACHE "" INTERNAL FORCE)
-find_package(Protobuf 3.0.0 REQUIRED)
+find_package(Protobuf REQUIRED)

get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${SELF_DIR}/Arcus-targets.cmake)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d736ba..66d6c13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ endif()
# However, if ProtobufConfig is used instead, there is a CMake option that controls
# this, which defaults to OFF. We need to force this option to ON instead.
set(protobuf_MODULE_COMPATIBLE ON CACHE INTERNAL "" FORCE)
-find_package(Protobuf 3.0.0 REQUIRED)
+find_package(Protobuf REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON) #Required if a patch to libArcus needs to be made via templates.

@@ -103,9 +103,8 @@ endif()
target_include_directories(Arcus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
- ${PROTOBUF_INCLUDE_DIR}
)
-target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES})
+target_link_libraries(Arcus PUBLIC protobuf::libprotobuf)

if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0600) # Declare we require Vista or higher, this allows us to use IPv6 functions.
9 changes: 5 additions & 4 deletions ports/arcus/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Ultimaker/libArcus
REF 617f6f71572090f73cb44592b12f49567b539e5b #v4.10.0
SHA512 cf0954d8b10d9f94165aa5c086d0e58c2925464f9fbe4252535c36d7e6bb12b767d89efb816c9e642f9cd7f0ec0d66d61ca21c5121a05340499d38d5d851f73b
HEAD_REF master
REF ${VERSION}
SHA512 452c541360d74a8f58ab1b20df59efd36756812a9ecd09804ba16877956fb240d367bd968271a9c010496598ef0b459f62aa287553d4ba3fdb4cd2742c25553f
HEAD_REF main
PATCHES
0001-fix-protobuf-deprecated.patch
0002-protobuf-version.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
Expand All @@ -26,4 +27,4 @@ vcpkg_cmake_config_fixup(PACKAGE_NAME Arcus CONFIG_PATH lib/cmake/Arcus)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
2 changes: 1 addition & 1 deletion ports/arcus/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arcus",
"version-semver": "4.10.0",
"port-version": 2,
"port-version": 3,
"description": "This library contains C++ bindings for creating a socket in a thread and using this socket to send and receive messages based on the Protocol Buffers library.",
"homepage": "https://github.com/Ultimaker/libArcus",
"supports": "!uwp",
Expand Down
11 changes: 6 additions & 5 deletions ports/braft/export-target.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a851c00..d18ecd0 100644
index 3d75dd5..090a02e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,7 +105,7 @@ if(BRPC_WITH_GLOG)
@@ -99,7 +99,7 @@ if(BRPC_WITH_GLOG)
${OPENSSL_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY}
dl
Expand All @@ -11,7 +11,7 @@ index a851c00..d18ecd0 100644
)
else()
set(DYNAMIC_LIB
@@ -117,7 +117,7 @@ else()
@@ -111,7 +111,7 @@ else()
${OPENSSL_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY}
dl
Expand All @@ -21,7 +21,7 @@ index a851c00..d18ecd0 100644
endif()

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 78adc56..0ab4dce 100644
index 78adc56..50cffc6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,8 +19,10 @@ add_library(braft-static STATIC $<TARGET_OBJECTS:OBJ_LIB>)
Expand All @@ -35,7 +35,7 @@ index 78adc56..0ab4dce 100644
target_link_libraries(braft-static PUBLIC ${DYNAMIC_LIB})
endif()

@@ -31,15 +33,31 @@ SET_TARGET_PROPERTIES(braft-shared PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUT
@@ -31,15 +33,32 @@ SET_TARGET_PROPERTIES(braft-shared PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUT
endif()

if (NOT BUILD_SHARED_LIBS)
Expand All @@ -58,6 +58,7 @@ index 78adc56..0ab4dce 100644
+[[include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(gflags CONFIG)
+find_dependency(Protobuf CONFIG)
+file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/unofficial-braftTargets.cmake")
+foreach (TARGET_FILE ${TARGET_FILES})
+ include("${TARGET_FILE}")
Expand Down
34 changes: 13 additions & 21 deletions ports/braft/fix-glog.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c88b0a2..bd3b74f 100644
index 090a02e..fbe0ac3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,12 +55,8 @@ if ((NOT GFLAGS_INCLUDE_PATH) OR (NOT GFLAGS_LIB))
Expand All @@ -18,30 +18,22 @@ index c88b0a2..bd3b74f 100644

if(LEVELDB_WITH_SNAPPY)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ff435a2..4e7591b 100644
index 70d73df..a3d3046 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,6 +10,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
@@ -11,6 +11,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src)

add_library(OBJ_LIB OBJECT ${SOURCES})
+target_include_directories(OBJ_LIB PUBLIC $<INSTALL_INTERFACE:include>)
+target_link_libraries(OBJ_LIB PUBLIC ${DYNAMIC_LIB})
+

+target_link_libraries(OBJ_LIB PUBLIC ${DYNAMIC_LIB})
set_property(TARGET ${OBJ_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1)
if (BUILD_SHARED_LIBS)
@@ -18,13 +21,6 @@ else()
add_library(braft-static STATIC $<TARGET_OBJECTS:OBJ_LIB>)
endif()

-if (BUILD_SHARED_LIBS)
-target_include_directories(braft-shared PUBLIC $<INSTALL_INTERFACE:include>)
-target_link_libraries(braft-shared PUBLIC ${DYNAMIC_LIB})
-else()
-target_include_directories(braft-static PUBLIC $<INSTALL_INTERFACE:include>)
-target_link_libraries(braft-static PUBLIC ${DYNAMIC_LIB})
-endif()

if (NOT BUILD_SHARED_LIBS)
SET_TARGET_PROPERTIES(braft-static PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUTPUT 1)
add_library(braft-shared SHARED $<TARGET_OBJECTS:OBJ_LIB>)
@@ -50,6 +51,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-braft-config.cmake"
[[include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_dependency(gflags CONFIG)
+find_dependency(glog CONFIG)
find_dependency(Protobuf CONFIG)
file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/unofficial-braftTargets.cmake")
foreach (TARGET_FILE ${TARGET_FILES})
1 change: 1 addition & 0 deletions ports/braft/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vcpkg_from_github(
export-target.patch
"${GCC_11_PATCH}"
fix-glog.patch
protobuf.patch
)

vcpkg_cmake_configure(
Expand Down
23 changes: 23 additions & 0 deletions ports/braft/protobuf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28c1026..65af3ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

include(FindThreads)
-include(FindProtobuf)
+find_package(Protobuf CONFIG REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why you are using CONFIG here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake has a build-in https://cmake.org/cmake/help/latest/module/FindProtobuf.html which does not setup abseil linkage properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is the case you install a vcpkg-cmake-wrapper.cmake and fix that. You do not patch every downstream consumer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On March 5, I proposed #35781 (comment)...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't exactly know what the wrapper does, sorry for not asking. I added CONFIG to the protobuf wrapper now, it reduces some of the patching (cld3, gamenetworkingsockets, libosmscout, libprotobuf-mutator, osgearth, pulsar-client, ecal) but also adds some (arcus, cartographer).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.
There is one problem which the wrapper can't solve: When you switch a port from LIBRARIES variable to the imported target, you must add find_dependency to exported config.
This could be avoided by keeping variables free of targets, but often this is (too) hard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you must add find_dependency to exported config.

I don't understand why this is a must, it is merely an inconvenience. Users can still consume these ports by adding the missing find_package calls for the dependencies themselves.

This could be avoided by keeping variables free of targets, but often this is (too) hard.

The way I changed protobuf's cmake-wrapper I no longer set these variables at all, not sure how it would help when most libs do target_link_libraries(target ${PROTOBUF_LIBRARIES}) anyways.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this is a must, it is merely an inconvenience. Users can still consume these ports by adding the missing find_package calls for the dependencies themselves.

It is not a must to have cmake packages at all... User can just use find_library directly.

Seriously, it is a must at least in vcpkg that find_package cares for transitive dependencies.

  • It is a fair requirement: Each (one!) package knows its direct requirements at build time.
  • It is not only inconvenient but also inefficient if (many!) users would need to work out networks of transitive dependencies.


if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# require at least gcc 4.8
@@ -69,7 +69,8 @@ if ((NOT BRPC_INCLUDE_PATH) OR (NOT BRPC_LIB))
message(FATAL_ERROR "Fail to find brpc")
endif()

-if (NOT PROTOBUF_PROTOC_EXECUTABLE)
+set(PROTOBUF_LIBRARY protobuf::libprotobuf)
+if (0)
Tradias marked this conversation as resolved.
Show resolved Hide resolved
get_filename_component(PROTO_LIB_DIR ${PROTOBUF_LIBRARY} DIRECTORY)
set (PROTOBUF_PROTOC_EXECUTABLE "${PROTO_LIB_DIR}/../bin/protoc")
endif()
2 changes: 1 addition & 1 deletion ports/braft/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "braft",
"version-date": "2021-26-04",
"port-version": 4,
"port-version": 5,
"description": "Consensus algorithm library",
"homepage": "https://github.com/baidu/braft",
"license": "Apache-2.0",
Expand Down
37 changes: 26 additions & 11 deletions ports/brpc/fix-build.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b14fe17..ecce87c 100644
index b14fe178..9e9a776a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,8 @@ endif()
Expand All @@ -12,12 +12,10 @@ index b14fe17..ecce87c 100644
if (NOT THRIFT_LIB)
message(FATAL_ERROR "Fail to find Thrift")
endif()
@@ -153,7 +154,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()
@@ -154,6 +155,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()

-find_package(Protobuf REQUIRED)
+find_package(protobuf CONFIG REQUIRED)
find_package(Protobuf REQUIRED)
+get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
+set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
if(Protobuf_VERSION GREATER 4.21)
Expand Down Expand Up @@ -78,8 +76,17 @@ index b14fe17..ecce87c 100644

if(WITH_BORINGSSL)
list(APPEND DYNAMIC_LIB ${BORINGSSL_SSL_LIBRARY})
@@ -520,7 +527,7 @@ compile_proto(PROTO_HDRS PROTO_SRCS ${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/src
"${PROTO_FILES}")
add_library(PROTO_LIB OBJECT ${PROTO_SRCS} ${PROTO_HDRS})
-
+target_link_libraries(PROTO_LIB PUBLIC ${DYNAMIC_LIB})
set(SOURCES
${BVAR_SOURCES}
${BTHREAD_SOURCES}
diff --git a/cmake/FindGFLAGS.cmake b/cmake/FindGFLAGS.cmake
index dfad5fd..8423d55 100644
index dfad5fd8..8423d55a 100644
--- a/cmake/FindGFLAGS.cmake
+++ b/cmake/FindGFLAGS.cmake
@@ -24,7 +24,9 @@ if (GFLAGS_STATIC)
Expand All @@ -94,18 +101,27 @@ index dfad5fd..8423d55 100644
set(GFLAGS_FOUND TRUE)
endif(GFLAGS_INCLUDE_PATH AND GFLAGS_LIBRARY)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1b4b233..8e836a4 100644
index 1b4b2332..638ec070 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,6 +31,7 @@ add_dependencies(SOURCES_LIB PROTO_LIB)
@@ -24,13 +24,16 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR}/src)

add_library(BUTIL_LIB OBJECT ${BUTIL_SOURCES})
+target_link_libraries(BUTIL_LIB PUBLIC ${DYNAMIC_LIB})
add_library(SOURCES_LIB OBJECT ${SOURCES})
+target_link_libraries(SOURCES_LIB PUBLIC ${DYNAMIC_LIB})
add_dependencies(SOURCES_LIB PROTO_LIB)

# shared library needs POSITION_INDEPENDENT_CODE
set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1)
set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1)

+if(NOT BUILD_SHARED_LIBS)
add_library(brpc-static STATIC $<TARGET_OBJECTS:BUTIL_LIB>
$<TARGET_OBJECTS:SOURCES_LIB>
$<TARGET_OBJECTS:PROTO_LIB>)
@@ -60,12 +61,19 @@ endfunction()
@@ -60,12 +63,19 @@ endfunction()


if(WITH_THRIFT)
Expand All @@ -127,7 +143,7 @@ index 1b4b233..8e836a4 100644
# for protoc-gen-mcpack
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/output/bin)

@@ -74,36 +82,64 @@ set(protoc_gen_mcpack_SOURCES
@@ -74,36 +84,63 @@ set(protoc_gen_mcpack_SOURCES
)

add_executable(protoc-gen-mcpack ${protoc_gen_mcpack_SOURCES})
Expand All @@ -151,7 +167,6 @@ index 1b4b233..8e836a4 100644
endif()
SET_TARGET_PROPERTIES(brpc-shared PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1)
-
+
+ if(0)
target_link_libraries(protoc-gen-mcpack brpc-shared ${DYNAMIC_LIB} pthread)
+ endif()
Expand Down
Loading
Loading