Skip to content

Commit dd11952

Browse files
authored
Updates on README (#17)
* Updated README with first details regarding QNX licenses. * Fixed typo in README about toolchain name. * Added README to examples.
1 parent 484d07a commit dd11952

2 files changed

Lines changed: 123 additions & 1 deletion

File tree

README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The registration of toolchains is done by adding command line option `--extra_to
110110
In case above this would be:
111111
```bash
112112
--extra_toolchains=@score_gcc_toolchain//:x86_64-linux-gcc-12.2.0
113-
--extra_toolchains=@score_gcc_qnx_toolchain//:x86_64-linux-sdp-8.0.0
113+
--extra_toolchains=@score_gcc_qnx_toolchain//:x86_64-qnx-sdp-8.0.0
114114
```
115115

116116
> NOTE: In case that more than one toolchain needs to be defined, the registration must be protected via config flags otherwise</br>
@@ -162,6 +162,68 @@ Example cover:
162162

163163
Documentation uses **Sphinx** and lives in `docs/`. (Not yet prepared!)
164164

165+
# QNX License
166+
167+
## Local License File
168+
169+
By default, the QNX toolchain uses `/opt/score_qnx/license/licenses` as the license path.
170+
If you want to change this location, you can override it by setting the `license_path` variable
171+
when calling the `gcc.toolchain(...)` function in your `MODULE.bazel` file.
172+
173+
**Example:**
174+
175+
```bazel
176+
gcc.toolchain(
177+
name = "score_qcc_toolchain",
178+
target_os = "qnx",
179+
...
180+
license_path = "/path/to/your/custom/licenses",
181+
)
182+
```
183+
184+
> **TODO:** Is it possible to set this via environment variable?
185+
186+
## License Servers
187+
188+
In case you are using a license server for QNX licenses (FLEXlm), you can set the license server information
189+
either locally in your module or centrally in your bazel configuration.
190+
This also applies to floating licenses.
191+
192+
### Module Local Configuration
193+
194+
You can set the license server for your toolchains by setting the variables `license_info_variable` and
195+
`license_info_url` when calling the `gcc.toolchain(...)` function in your `MODULE.bazel` file.
196+
197+
**Example (for QNXLM_LICENSE_FILE variable):**
198+
199+
```bazel
200+
gcc.toolchain(
201+
name = "score_qcc_toolchain",
202+
target_os = "qnx",
203+
...
204+
license_info_variable = "QNXLM_LICENSE_FILE",
205+
license_info_url = "<port>@<license_server_host>",
206+
)
207+
```
208+
209+
### Central Configuration
210+
211+
In case you want to set the license server for all your bazel projects you can set the
212+
environment variable in your `~/.bazelrc` file:
213+
214+
**Example (for QNXLM_LICENSE_FILE variable):**
215+
216+
```bazel
217+
common --action_env=QNXLM_LICENSE_FILE=<port>@<license_server_host>
218+
```
219+
220+
In case you do not want to set it for all commands you can also set it per build/test command:
221+
222+
```bazel
223+
build --action_env=QNXLM_LICENSE_FILE=<port>@<license_server_host>
224+
test --action_env=QNXLM_LICENSE_FILE=<port>@<license_server_host>
225+
```
226+
165227
# Adding New Toolchain Versions
166228

167229
1. Update `packages/version_matrix.bzl`

examples/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Bazel C++ Toolchains Examples
2+
3+
This directory contains example C++ projects demonstrating how to use the SCORE Bazel C++ toolchains with various target platforms and configurations.
4+
5+
## Configuration Details
6+
7+
The toolchain configurations are defined in:
8+
- **`.bazelrc`** - Build configurations and platform settings
9+
- **`MODULE.bazel`** - Toolchain dependencies and setup
10+
11+
## Building Targets
12+
13+
### Default Toolchain
14+
15+
Build a specific target with the default toolchain:
16+
```bash
17+
bazel build //:main_cpp
18+
bazel test //:math_lib_test
19+
```
20+
21+
### x86_64 Linux Builds
22+
23+
**Using the default GCC toolchain with pthread support:**
24+
```bash
25+
bazel build --config=host_config_1 //:main_pthread_cpp
26+
bazel test --config=host_config_1 //:math_lib_test
27+
```
28+
29+
**Using the custom GCC toolchain:**
30+
```bash
31+
bazel build --config=host_config_2 //:main_cpp
32+
```
33+
34+
**Using the base platform configuration:**
35+
```bash
36+
bazel build --config=x86_64-linux //:main_cpp
37+
```
38+
39+
### aarch64 Linux Cross-Compilation
40+
41+
**Build for ARM64 Linux:**
42+
```bash
43+
bazel build --config=target_config_3 //:main_cpp
44+
bazel build --config=target_config_3 //:main_pthread_cpp
45+
```
46+
47+
### QNX Target Builds
48+
49+
> **Note:** Take care of license requirements when using these toolchains and dependencies in your projects.
50+
See main README.md for details.
51+
52+
**Build for x86_64 QNX:**
53+
```bash
54+
bazel build --config=target_config_1 //:main_cpp
55+
```
56+
57+
**Build for aarch64 QNX:**
58+
```bash
59+
bazel build --config=target_config_2 //:main_cpp
60+
```

0 commit comments

Comments
 (0)