{"id":19933730,"url":"https://github.com/bazelbuild/rules_cc","last_synced_at":"2025-05-16T03:07:21.406Z","repository":{"id":34500935,"uuid":"161776641","full_name":"bazelbuild/rules_cc","owner":"bazelbuild","description":"C++ Rules for Bazel","archived":false,"fork":false,"pushed_at":"2025-05-05T06:43:28.000Z","size":1100,"stargazers_count":205,"open_issues_count":101,"forks_count":121,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-05-05T07:38:32.888Z","etag":null,"topics":["bazel","bazel-rules","c","cpp","rules-cc"],"latest_commit_sha":null,"homepage":"https://bazel.build","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazelbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-14T11:38:13.000Z","updated_at":"2025-05-05T06:43:31.000Z","dependencies_parsed_at":"2023-02-18T09:01:22.373Z","dependency_job_id":"59c3b19b-2782-47e1-920f-69ffff0f4346","html_url":"https://github.com/bazelbuild/rules_cc","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_cc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_cc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_cc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_cc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazelbuild","download_url":"https://codeload.github.com/bazelbuild/rules_cc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","bazel-rules","c","cpp","rules-cc"],"created_at":"2024-11-12T23:14:40.670Z","updated_at":"2025-05-16T03:07:16.386Z","avatar_url":"https://github.com/bazelbuild.png","language":"Starlark","readme":"# C++ rules for Bazel\n\n* Postsubmit [![Build status](https://badge.buildkite.com/f03592ae2d7d25a2abc2a2ba776e704823fa17fd3e061f5103.svg?branch=main)](https://buildkite.com/bazel/rules-cc)\n* Postsubmit + Current Bazel Incompatible flags [![Build status](https://badge.buildkite.com/5ba709cc33e5855078a1f8570adcf8e0a78ea93591bc0b4e81.svg?branch=master)](https://buildkite.com/bazel/rules-cc-plus-bazelisk-migrate)\n\nThis repository contains a Starlark implementation of C++ rules in Bazel.\n\nThe rules are being incrementally converted from their native implementations in the [Bazel source tree](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/).\n\nFor the list of C++ rules, see the Bazel\n[documentation](https://docs.bazel.build/versions/main/be/overview.html).\n\n# Getting Started\n\nAdd the following to your `WORKSPACE` file:\n\n```starlark\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"rules_cc\",\n    urls = [\"https://github.com/bazelbuild/rules_cc/archive/refs/tags/\u003cVERSION\u003e.tar.gz\"],\n    sha256 = \"...\",\n)\n```\n\nThen, in your `BUILD` files, import and use the rules:\n\n```starlark\nload(\"@rules_cc//cc:defs.bzl\", \"cc_library\")\n\ncc_library(\n    ...\n)\n```\n\n# Using the rules_cc toolchain\n\nThis repo contains an auto-detecting toolchain that expects to find tools installed on your host machine.\nThis is non-hermetic, and may have varying behaviors depending on the versions of tools found.\n\nThere are third-party contributed hermetic toolchains you may want to investigate:\n\n- LLVM: \u003chttps://github.com/bazel-contrib/toolchains_llvm\u003e\n- GCC (Linux only): \u003chttps://github.com/f0rmiga/gcc-toolchain\u003e\n- zig cc: \u003chttps://github.com/uber/hermetic_cc_toolchain\u003e\n\nIf you'd like to use the cc toolchain defined in this repo, add this to\nyour `WORKSPACE` after you include rules_cc:\n\n```bzl\nload(\"@rules_cc//cc:repositories.bzl\", \"rules_cc_dependencies\", \"rules_cc_toolchains\")\n\nrules_cc_dependencies()\n\nrules_cc_toolchains()\n```\n\n# Migration Tools\n\nThis repository also contains migration tools that can be used to migrate your\nproject for Bazel incompatible changes.\n\n## Legacy fields migrator\n\nScript that migrates legacy crosstool fields into features\n([incompatible flag](https://github.com/bazelbuild/bazel/issues/6861), \n[tracking issue](https://github.com/bazelbuild/bazel/issues/5883)).\n\nTLDR:\n\n```\nbazel run @rules_cc//tools/migration:legacy_fields_migrator -- \\\n  --input=my_toolchain/CROSSTOOL \\\n  --inline\n```\n\n# Contributing\n\nBazel and `rules_cc` are the work of many contributors. We appreciate your help!\n\nTo contribute, please read the contribution guidelines: [CONTRIBUTING.md](https://github.com/bazelbuild/rules_cc/blob/main/CONTRIBUTING.md).\n\nNote that the `rules_cc` use the GitHub issue tracker for bug reports and feature requests only.\nFor asking questions see:\n\n* [Stack Overflow](https://stackoverflow.com/questions/tagged/bazel)\n* [`rules_cc` mailing list](https://groups.google.com/forum/#!forum/cc-bazel-discuss)\n* Slack channel `#cc` on [slack.bazel.build](https://slack.bazel.build)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Frules_cc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazelbuild%2Frules_cc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Frules_cc/lists"}