Commit 14158dc
committed
build: statically link OpenSSL into the static library
Pass OPENSSL_STATIC=1 to the staticlib cargo_build() invocation so
openssl-sys links OpenSSL statically into libscylla-cpp-driver_static.a.
This makes the static archive truly self-contained — users only need
to link system libraries and OpenSSL's pkg-config dependencies.
Since the cdylib and staticlib builds share CARGO_TARGET_DIR but pass
different OPENSSL_STATIC values, they must not run concurrently —
openssl-sys declares rerun-if-env-changed for that variable, and
parallel invocations would thrash its build script cache. Serialize
by making the staticlib target depend on the cdylib target when both
are enabled.
Append platform-specific system libraries to the static .pc file's
Libs: line via @native_static_libs@. These are needed by the Rust
runtime (pthreads, libdl, libm, etc.) and must be provided by the
final linker when linking the static archive into an executable.
Add libssl-dev to the list of build dependencies, since the static build
needs static OpenSSL libraries, which are not provided by libssl1.1.1 parent 226a0ae commit 14158dc
3 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
| |||
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
0 commit comments