feat: support public/interface dependencies in packer

This commit is contained in:
2026-08-06 12:48:41 +08:00
parent 7527d3763f
commit ccf19ac0ab
7 changed files with 148 additions and 7 deletions
+22
View File
@@ -39,6 +39,20 @@ namespace_name = "foobar"
# Target-name part of the generated CMake target.
# This property is optional; it defaults to the name of the target Rust project.
target_name = "foobar"
# Declared CMake dependencies.
# Each entry carries a `package` (passed to find_dependency argument) and a `target`
# (linked into the generated imported target via INTERFACE_LINK_LIBRARIES).
# This property is optional; it defaults to no dependencies.
# Because the packer only ever ships dynamic libraries, there are no private or
# static dependencies, and no separate field for them.
# Declaring dependencies here is rarely necessary and is NOT recommended: it
# behaves like a CMake interface/public dependency, and exposing other
# libraries' raw types across the FFI boundary raises ABI-compatibility
# concerns across runtimes. Use it only when this crate is explicitly a wrapper
# around another library.
dependencies = [
{ package = "ZLIB 1.3.2 REQUIRED", target = "ZLIB::ZLIB" },
]
[package.metadata.omrf.pkgconfig]
# The unique identifier of the package.
@@ -50,6 +64,14 @@ name = "Foo Bar"
# Brief description of the package.
# This property is optional; it defaults to the description of the target Rust project.
description = "a brown fox jumps over a lazy dog."
# Declared public pkg-config dependencies.
# This property is optional; it defaults to no dependencies.
# Because the packer only ever ships dynamic libraries, there are no private
# dependencies and Requires.private is not used.
# Declaring dependencies here is rarely necessary and is NOT recommended, for
# the same ABI-compatibility reasons as the CMake dependencies above. Use it
# only when this crate is explicitly a wrapper around another library.
requires = ["libfoo >= 1.0", "libbar"]
```