Skip to content

Commit

Permalink
[README] added .bazelrc
Browse files Browse the repository at this point in the history
  • Loading branch information
hexdae committed Jun 13, 2020
1 parent c24593c commit fe41b5a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ If this project was useful to you, give it a ⭐️ and I'll keep improving it!

## Using the nRF5 Bazel rules

### `WORKSPACE`

Add this to your `WORKSPACE`, based on the version you want to use. For example, for v1.0:

```python
Expand All @@ -19,7 +21,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "nRF5",
url = "https://github.com/d-asnaghi/bazel-nordic-sdk/archive/v1.0.tar.gz",
sha256 = "453bf92e953245bf78c4b944489962cbb5715d31d85de17b1c05567286b4c91f",
sha256 = "6ecb846291fcb51b8abb210ed35e4a27ba263e80b15d76f3ddf707a9f3bea93d",
strip_prefix = "bazel-nordic-sdk-1.0"
)

Expand All @@ -31,6 +33,19 @@ arm_none_eabi_deps()

```

### `.bazelrc`

Enable `cc_toolchain` resolution

```bash
# .bazelrc

# Enable toolchain resolution
build --incompatible_enable_cc_toolchain_resolution
```

### `BUILD`

Then you can the `nrf_binary` rule to build firmware in your `BUILD` files.
Just use it as you would use the `cc_binary` rule, and by adding the custom
attributes `linker`, `sdk_srcs`, and `sdk_includes` if you need files from
Expand Down

0 comments on commit fe41b5a

Please sign in to comment.