Skip to content

objc_library lacks local_defines, unlike cc_library #17482

@jiawen

Description

@jiawen

Description of the feature request:

Like the title says, cc_library has a handy local_defines attribute that lets the BUILD file pass preprocessor definitions to a library but not its dependents. However, objc_library lacks the corresponding attribute.

What underlying problem are you trying to solve with this feature?

Passing locally scoped preprocessor definitions (e.g., #define NUM_THREADS 3 and have it not leak out to everyone that depends on it since it the name may not be unique.

Which operating system are you running Bazel on?

MacOS Ventura

What is the output of bazel info release?

release 5.3.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

N/A

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

N/A

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)team-Rules-ObjCIssues for Objective-C maintainerstype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions