Skip to content

Conversation

@shanemeagher
Copy link
Contributor

rust-mdns is still the default but can also be specified explicitly with
--feature "with-internal-mdns" switch at build time.

Added --feature "with-external-mdns" switch to build librespot to use
avahi for discovery using dns-sd package.

This commit does not provide option for building without mdns.

This pull request replaces pull request #201 started by @awiouy and has been rebased on the current master branch.

rust-mdns is still the default but can also be specified explicitly with
--feature "with-internal-mdns" switch at build time.
Added --feature "with-external-mdns" switch to build librespot to use
avahi for discovery using dns-sd package.
This commit does not provide option for building without mdns.
@shanemeagher shanemeagher changed the title Allow avahi support using dns-sd support for Discovery Allow avahi support using dns-sd for Discovery Sep 5, 2017
@shanemeagher
Copy link
Contributor Author

@plietar,
It seems I'm still having an issue when building with --no-default-features. As mdns is optional and not a dependency of an enabled feature (with-internal-mdns) in cargo.toml, cargo doesn't pass it to rustc.

In src/lib.rs, I've used cfg-if to reference mdns:

cfg_if! {
    if #[cfg(feature = "with-internal-mdns")] {
        extern crate mdns;
    } else if #[cfg(feature = "with-external-mdns")] {
        extern crate dns_sd;
    } else {
        extern crate mdns;
    }
}

resulting in this error: https://travis-ci.org/plietar/librespot/jobs/272099406#L929

In the PR201, you asked:

Did you use #[cfg(mdns)] around the extern crate mdns ?
Would this not have just checked if the dependency mdns was enabled? Which it isn't?

Is there a way to make one of the features a default requirement if none is specified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant