Skip to content

[Suggestion]: Use alwayslink = True for //:gtest_main target #4868

@phst

Description

@phst

Describe the issue

This isn't really a bug (seems like Googletest works just fine without alwayslink), more of a suggestion. Since the main function is always needed but never directly referenced, it might make sense to mark //:gtest_main with alwayslink = True. This might also help tools like Gazelle understand that the dependency on //:gtest_main is needed and shouldn't be removed.

Steps to reproduce the problem

Check that //:gtest_main in //:BUILD.bazel isn't marked with alwayslink = True

What version of GoogleTest are you using?

1.17.0.bcr.2

What operating system and version are you using?

macOS

What compiler and version are you using?

Apple clang version 17.0.0

What build system are you using?

bazel 8.4.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions