zchuango commented on code in PR #3475:
URL: https://github.com/apache/brpc/pull/3475#discussion_r3835825641
##########
src/CMakeLists.txt:
##########
@@ -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})
Review Comment:
ZLIB_INCLUDE_DIRS is a documented result variable provided by the same
FindZLIB invocation that creates ZLIB::ZLIB. It is used explicitly here because
BEFORE ordering is required to prevent inherited include directories from
shadowing the intended zlib.h.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]