Skip to content

Commit fdd051c

Browse files
committed
Add more use cases in example
1 parent 767087c commit fdd051c

3 files changed

Lines changed: 45 additions & 7 deletions

File tree

examples/.bazelrc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,22 @@ build:x86_64-linux --config=shared
2929
# Different toolchain configuration for x86_64-linux
3030
# -------------------------------------------------------------------------------
3131
build:host_config_1 --config=x86_64-linux
32-
build:host_config_1 --extra_toolchains=@score_gcc_toolchain//:x86_64-linux
33-
build:host_config_1 --features=use_pthread
32+
build:host_config_1 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
33+
build:host_config_1 --extra_toolchains=@score_gcc_toolchain//:x86_64-linux-gcc_12.2.0-posix
3434

3535
# -------------------------------------------------------------------------------
36-
# Different toolchain configuration for x86_64-linux
36+
# Different toolchain configuration for x86_64-linux (base platforms only)
3737
# -------------------------------------------------------------------------------
3838
build:host_config_2 --config=x86_64-linux
39-
build:host_config_2 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
40-
build:host_config_2 --extra_toolchains=@my_toolchain//:x86_64-linux-gcc_12.2.0-posix
39+
build:host_config_2 --extra_toolchains=@score_gcc_toolchain_bp_only//:x86_64-linux
40+
build:host_config_2 --features=use_pthread
41+
42+
# -------------------------------------------------------------------------------
43+
# Different toolchain configuration for x86_64-linux
44+
# -------------------------------------------------------------------------------
45+
build:host_config_3 --config=x86_64-linux
46+
build:host_config_3 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
47+
build:host_config_3 --extra_toolchains=@my_toolchain//:x86_64-linux-gcc_12.2.0-posix
4148

4249
# -------------------------------------------------------------------------------
4350
# Config dedicated to target platform CPU:aarch64 and OS:linux
@@ -51,7 +58,6 @@ build:aarch64-linux --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.
5158
build:target_config_3 --config=aarch64-linux
5259
build:target_config_3 --extra_toolchains=@score_aarch64_gcc_toolchain//:aarch64-linux-gcc_12.2.0-posix
5360

54-
5561
# -------------------------------------------------------------------------------
5662
# Config dedicated to target platform CPU:x86_64 and OS:QNX
5763
# -------------------------------------------------------------------------------

examples/MODULE.bazel

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,22 @@ gcc.toolchain(
6565
target_os = "linux",
6666
version = "12.2.0",
6767
use_default_package = True,
68+
)
69+
70+
# *******************************************************************************
71+
# Setting GCC (CPU:x86_64|OS:Linux)
72+
# *******************************************************************************
73+
gcc.toolchain(
74+
name = "score_gcc_toolchain_bp_only",
75+
target_cpu = "x86_64",
76+
target_os = "linux",
77+
version = "12.2.0",
78+
use_default_package = True,
6879
use_base_constraints_only = True,
6980
)
7081

7182
# *******************************************************************************
72-
# Setting default GCC (CPU:aarch64|OS:Linux|V:12.2.0|ES:posix)
83+
# Setting GCC (CPU:aarch64|OS:Linux|V:12.2.0|ES:posix)
7384
# *******************************************************************************
7485
gcc.toolchain(
7586
name = "score_aarch64_gcc_toolchain",
@@ -150,6 +161,7 @@ gcc.toolchain(
150161
use_repo(
151162
gcc,
152163
"score_gcc_toolchain",
164+
"score_gcc_toolchain_bp_only",
153165
"score_aarch64_gcc_toolchain",
154166
"my_toolchain",
155167
"score_qcc_toolchain",

examples/test.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
echo -e "Testing 'host_config_1' ..."
4+
bazel build --config host_config_1 //:main_cpp
5+
bazel clean
6+
echo -e "Testing 'host_config_2' ..."
7+
bazel build --config host_config_2 //:main_cpp
8+
bazel clean
9+
echo -e "Testing 'host_config_3' ..."
10+
bazel build --config host_config_3 //:main_cpp
11+
bazel clean
12+
echo -e "Testing 'target_config_1' ..."
13+
bazel build --config target_config_1 //:main_cpp
14+
bazel clean
15+
echo -e "Testing 'target_config_2' ..."
16+
bazel build --config target_config_2 //:main_cpp
17+
bazel clean
18+
echo -e "Testing 'target_config_3' ..."
19+
bazel build --config target_config_3 //:main_cpp
20+
bazel clean

0 commit comments

Comments
 (0)