When building, SwiftPM emits the following message:
'Cdns_sd' (...): warning: system packages are deprecated; use system library targets instead
I'm not aware of what constitutes a system library target and the Documentation regarding system packages (not libraries) still shows how to create a package-per-library.
OTOH there's manifest v4.2, that shows how to create a system library target:
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "ZLib",
products: [
.library(name: "ZLib", targets: ["ZLib"]),
],
targets: [
.systemLibrary(
name: "CZLib")
.target(
name: "ZLib",
dependencies: ["CZLib"]),
]
)
However, that documentation doesn't include any information (if at all possible) on how to specify pkgConfig
and providers
; e.g.
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "Cdns_sd",
pkgConfig: "avahi-compat-libdns_sd",
providers: [
.apt(["libavahi-compat-libdnssd-dev"])
]
)
Finally; there might be shim.h
files involved to import the desired headers.
#include <dns_sd.h>
And even module maps:
module Cdns_sd [system] {
header "shim.h"
link "dns_sd"
export *
}
So I'm left wondering, what is this warning about; how does one actually migrate to this new target?