Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()

find_package(Protobuf REQUIRED)
find_package(ZLIB REQUIRED)
if(Protobuf_VERSION VERSION_GREATER 4.21)
# required by absl
set(BRPC_CXX_STANDARD 17)
Expand Down Expand Up @@ -351,7 +352,7 @@ set(DYNAMIC_LIB
${CMAKE_THREAD_LIBS_INIT}
${THRIFT_LIB}
dl
z)
ZLIB::ZLIB)

if(WITH_BORINGSSL)
list(APPEND DYNAMIC_LIB ${BORINGSSL_SSL_LIBRARY})
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ add_dependencies(SOURCES_LIB PROTO_LIB)
target_link_libraries(BUTIL_LIB PRIVATE brpc_common_config)
target_link_libraries(SOURCES_LIB PRIVATE brpc_common_config)

# protobuf/io/gzip_stream.h includes <zlib.h>. Prioritize the discovered
# zlib headers over include directories inherited from parent projects.
target_include_directories(SOURCES_LIB BEFORE PRIVATE ${ZLIB_INCLUDE_DIRS})
Comment thread
zchuango marked this conversation as resolved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be addressed at the parent project level by scoping the include paths to the intended modules, rather than modifying brpc's internal header order.


# 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)
Expand Down
Loading