Skip to content

Commit 226a0ae

Browse files
committed
build: use Requires.private for OpenSSL in static pkg-config file
Change Requires to Requires.private in the static library's .pc file. Requires.private means pkg-config only exposes the dependency's flags when the consumer passes --static. Without --static, the dependency is ignored entirely. This is the correct semantics because: - OpenSSL is an internal implementation detail, not exposed in the public API headers. Consumers don't need OpenSSL's -I flags to compile against the driver. - Anyone linking the static .a should be using --static, which pulls in Requires.private deps. So static consumers still get -lssl. - If a consumer mistakenly uses the static .pc without --static (e.g. linking the .a directly), Requires would needlessly add OpenSSL flags that may conflict with their own OpenSSL usage. This matches the convention used by OpenSSL's own libssl.pc, which declares Requires.private: libcrypto rather than Requires:.
1 parent ebff852 commit 226a0ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scylla-rust-wrapper/scylla-cpp-driver_static.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ includedir=@includedir@
66
Name: scylla-cpp-rs-driver
77
Description: ScyllaDB CPP RS Driver
88
Version: @version@
9-
Requires: openssl
9+
Requires.private: openssl
1010
Libs: -L${libdir} -lscylla-cpp-driver_static
1111
Cflags: -I${includedir}
1212
URL: https://github.com/scylladb/cpp-rs-driver/

0 commit comments

Comments
 (0)