Skip to content

jimrogerz/status_macros

Repository files navigation

Google C++ Status Macros

This repository contains a minimal bazel build target for Google C++ status macros, redistributed from mediapipe.

Setup

Bzlmod

This repo supports integration with Bzlmod.

I'll see if I can get this in the central repository, but for now looks like you'll have to set it up with a local registry.

WORKSPACE

If you're not using Bzlmod, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "status_macros",
    commit = "1592ab2d4b4f92976fc3f4a6cb3a1323a4b549c3",
    remote = "https://github.com/jimrogerz/status_macros.git",
)

Also make sure you have transitive dependencies from this repo's WORKSPACE.

BUILD

Add "@status_macros//:status_macros" to BUILD deps for targets that use this.

Usage

Add #include "status_macros.h" to your source.

See RETURN_IF_ERROR and ASSIGN_OR_RETURN.