Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stb #3469

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add stb #3469

wants to merge 6 commits into from

Conversation

hofbi
Copy link
Contributor

@hofbi hofbi commented Dec 20, 2024

@hofbi
Copy link
Contributor Author

hofbi commented Dec 20, 2024

@bazel-io skip_check unstable_url

@bazel-io
Copy link
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (stb) have been updated in this PR. Please review the changes.

@bazel-io bazel-io added the skip-url-stability-check Skip the URL stability check for the PR label Dec 20, 2024
@fmeum fmeum added the presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval label Dec 20, 2024
@fmeum fmeum changed the title Add std Add stb Dec 21, 2024
cc_library(
name = "stb_image",
hdrs = ["stb_image.h"],
defines = ["STB_IMAGE_IMPLEMENTATION"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on https://github.com/nothings/stb?tab=readme-ov-file#how-do-i-use-these-libraries, wouldn't all targets need to look like this?

cc_library(
    name = "stb_thing",
    hdrs = ["stb_thing.h"],
    # A generated file that includes the header after defining `STB_THING_IMPLEMENTATION`.
    srcs = ["stb_thing.c"],
    ...
)

This would allow users to use the headers without having to worry about the "include in exactly one source file" bit. You could probably get away with an empty source file if you use local_defines to set the macro and -include to force inclusion of the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval skip-url-stability-check Skip the URL stability check for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants