Skip to content

Commit

Permalink
staticlib alias
Browse files Browse the repository at this point in the history
Summary: emit aliases for public staticlibs.

Reviewed By: dtolnay

Differential Revision: D53824243

fbshipit-source-id: 89bd601d3985d7cd3ea917c900762b0c426196ba
  • Loading branch information
Shayne Fletcher authored and facebook-github-bot committed Feb 16, 2024
1 parent a34b75c commit 5dc23e8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/buckify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,13 @@ fn generate_target_rules<'scope>(
// Library, procmacro, cdylib, or staticlib
let mut rules = vec![];

// The root package is public but we don't expose it via
// an alias. The root package library is exposed directly.
if index.is_public_target(pkg, TargetReq::Lib) && !index.is_root_package(pkg) {
// The root package is public but we don't expose it via an alias. The
// root package library is exposed directly. In the case the root
// package is public and the target is a staticlib we do expose it via
// an alias.
if index.is_public_target(pkg, TargetReq::Lib) && !index.is_root_package(pkg)
|| index.is_public_target(pkg, TargetReq::Staticlib)
{
rules.push(Rule::Alias(Alias {
name: index.public_rule_name(pkg),
actual: index.private_rule_name(pkg),
Expand Down

0 comments on commit 5dc23e8

Please sign in to comment.