Skip to content

Commit fa84c71

Browse files
committed
Temp commit - not working
1 parent a574e17 commit fa84c71

11 files changed

Lines changed: 327 additions & 275 deletions

File tree

examples/.bazelrc

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,60 +18,45 @@ common --registry=https://bcr.bazel.build
1818
# Shared configuration for simple test execution
1919
build:shared --incompatible_strict_action_env
2020
build:shared --sandbox_writable_path=/var/tmp
21-
build:shared --host_platform=@score_bazel_platforms//:x86_64-linux
21+
build:shared --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
2222

2323
# -------------------------------------------------------------------------------
24-
# Config dedicated to host platform CPU:x86_64 and OS:Linux
24+
# Different toolchain configuration for x86_64-linux (host)
2525
# -------------------------------------------------------------------------------
26-
build:x86_64-linux --config=shared
27-
build:x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
28-
29-
# -------------------------------------------------------------------------------
30-
# Different toolchain configuration for x86_64-linux
31-
# -------------------------------------------------------------------------------
32-
build:host_config_1 --config=x86_64-linux
26+
build:host_config_1 --config=shared
3327
build:host_config_1 --extra_toolchains=@score_gcc_toolchain//:x86_64-linux-gcc_12.2.0-posix
34-
build:host_config_1 --features=use_pthread
28+
build:host_config_1 --host_features=use_pthread
3529

3630
# -------------------------------------------------------------------------------
37-
# Different toolchain configuration for x86_64-linux
31+
# Different toolchain configuration for x86_64-linux (host)
3832
# -------------------------------------------------------------------------------
39-
build:host_config_2 --config=x86_64-linux
33+
build:host_config_2 --config=shared
4034
build:host_config_2 --extra_toolchains=@my_toolchain//:x86_64-linux-gcc_12.2.0-posix
4135

4236
# -------------------------------------------------------------------------------
43-
# Config dedicated to target platform CPU:aarch64 and OS:linux
44-
# -------------------------------------------------------------------------------
45-
build:aarch64-linux --config=shared
46-
build:aarch64-linux --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
47-
48-
# -------------------------------------------------------------------------------
49-
# Different toolchain configuration for aarch64-linux
50-
# -------------------------------------------------------------------------------
51-
build:target_config_3 --config=aarch64-linux
52-
build:target_config_3 --extra_toolchains=@score_aarch64_gcc_toolchain//:aarch64-linux-gcc_12.2.0-posix
53-
54-
55-
# -------------------------------------------------------------------------------
56-
# Config dedicated to target platform CPU:x86_64 and OS:QNX
37+
# Toolchain configuration for x86_64-qnx (target)
5738
# -------------------------------------------------------------------------------
58-
build:x86_64-qnx --config=shared
59-
build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
39+
build:target_config_1 --config=host_config_1
40+
build:target_config_1 --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
41+
build:target_config_1 --extra_toolchains=@score_qcc_toolchain//:x86_64-qnx-sdp_8.0.0-posix
6042

6143
# -------------------------------------------------------------------------------
62-
# Different toolchain configuration for x86_64-qnx
44+
# Toolchain configuration for aarch64-qnx (target)
6345
# -------------------------------------------------------------------------------
64-
build:target_config_1 --config=x86_64-qnx
65-
build:target_config_1 --extra_toolchains=@score_qcc_toolchain//:x86_64-qnx-sdp_8.0.0-posix
46+
build:target_config_2 --config=host_config_1
47+
build:target_config_2 --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
48+
build:target_config_2 --extra_toolchains=@score_qcc_arm_toolchain//:aarch64-qnx-sdp_8.0.0-posix
6649

6750
# -------------------------------------------------------------------------------
68-
# Config dedicated to target platform CPU:aarch64 and OS:QNX
51+
# Toolchain configuration for aarch64-linux (target)
6952
# -------------------------------------------------------------------------------
70-
build:aarch64-qnx --config=shared
71-
build:aarch64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
53+
build:target_config_3 --config=host_config_1
54+
build:target_config_3 --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
55+
build:target_config_3 --extra_toolchains=@score_aarch64_gcc_toolchain//:aarch64-linux-gcc_12.2.0-posix
7256

7357
# -------------------------------------------------------------------------------
74-
# Different toolchain configuration for aarch64-qnx
58+
# Toolchain configuration for aarch64-linux (target)
7559
# -------------------------------------------------------------------------------
76-
build:target_config_2 --config=aarch64-qnx
77-
build:target_config_2 --extra_toolchains=@score_qcc_arm_toolchain//:aarch64-qnx-sdp_8.0.0-posix
60+
build:target_config_4 --config=host_config_1
61+
build:target_config_4 --platforms=@score_bazel_platforms//:x86_64-linux-glibc_2.39-autosd
62+
build:target_config_4 --extra_toolchains=@score_autosd_10_toolchain//:x86_64-linux-glibc_2.39-autosd

examples/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
"""Small C++ CLI application for sanity testing"""
1515

16-
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "cc_shared_library")
16+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library", "cc_test")
1717

1818
cc_binary(
1919
name = "main_cpp",
@@ -34,8 +34,8 @@ cc_library(
3434
cc_test(
3535
name = "math_lib_test",
3636
srcs = ["math_lib_test.cpp"],
37-
deps = [":math_lib"],
3837
linkstatic = True,
38+
deps = [":math_lib"],
3939
)
4040

4141
cc_shared_library(
@@ -47,9 +47,9 @@ cc_shared_library(
4747
cc_test(
4848
name = "math_lib_dyn_test",
4949
srcs = ["math_lib_test.cpp"],
50-
deps = [":math_lib"],
5150
dynamic_deps = [":math_lib_shared"],
5251
linkstatic = False,
52+
deps = [":math_lib"],
5353
)
5454

5555
cc_test(
@@ -59,5 +59,5 @@ cc_test(
5959
deps = [
6060
"@googletest//:gtest",
6161
"@googletest//:gtest_main",
62-
]
62+
],
6363
)

examples/MODULE.bazel

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ bazel_dep(name = "bazel_skylib", version = "1.8.2")
2626
# *******************************************************************************
2727
bazel_dep(name = "platforms", version = "1.0.0")
2828
bazel_dep(name = "score_bazel_platforms", version = "0.0.4")
29+
local_path_override(
30+
module_name = "score_bazel_platforms",
31+
path = "../../bazel_platforms",
32+
)
2933

3034
# *******************************************************************************
3135
# C++ Rules for Bazel
@@ -63,8 +67,8 @@ gcc.toolchain(
6367
name = "score_gcc_toolchain",
6468
target_cpu = "x86_64",
6569
target_os = "linux",
66-
version = "12.2.0",
6770
use_default_package = True,
71+
version = "12.2.0",
6872
)
6973

7074
# *******************************************************************************
@@ -74,84 +78,75 @@ gcc.toolchain(
7478
name = "score_aarch64_gcc_toolchain",
7579
target_cpu = "aarch64",
7680
target_os = "linux",
77-
version = "12.2.0",
7881
use_default_package = True,
79-
)
82+
version = "12.2.0",
83+
)
8084

8185
# *******************************************************************************
8286
# Setting custom GCC (CPU:x86_64|OS:Linux|V:12.2.0|ES:posix)
8387
# *******************************************************************************
8488
gcc.sdp(
8589
name = "my_toolchain_pkg",
86-
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz",
87-
strip_prefix = "x86_64-unknown-linux-gnu",
88-
sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600",
8990
build_file = "@score_bazel_cpp_toolchains//packages/linux/x86_64/gcc/12.2.0:gcc.BUILD",
91+
sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600",
92+
strip_prefix = "x86_64-unknown-linux-gnu",
93+
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz",
9094
)
9195
gcc.toolchain(
9296
name = "my_toolchain",
97+
extra_link_flags = [
98+
"-lpthread",
99+
],
93100
sdp_to_link = "my_toolchain_pkg",
94-
target_os = "linux",
95101
target_cpu = "x86_64",
102+
target_os = "linux",
96103
version = "12.2.0",
97-
extra_link_flags = [
98-
"-lpthread",
99-
]
100104
)
101105

102106
# *******************************************************************************
103107
# Setting GCC (CPU:x86_64|OS:QNX|version(sdp):8.0.0|ES:posix)
104108
# *******************************************************************************
105109
gcc.toolchain(
106110
name = "score_qcc_toolchain",
111+
sdp_version = "8.0.0",
107112
target_cpu = "x86_64",
108113
target_os = "qnx",
109-
sdp_version = "8.0.0",
110-
version = "12.2.0",
111114
use_default_package = True,
115+
version = "12.2.0",
112116
)
113117

114118
# *******************************************************************************
115119
# Setting GCC (CPU:aarch64|OS:QNX|version(sdp):8.0.0|ES:posix)
116120
# *******************************************************************************
117121
gcc.toolchain(
118122
name = "score_qcc_arm_toolchain",
123+
sdp_version = "8.0.0",
119124
target_cpu = "aarch64",
120125
target_os = "qnx",
121-
sdp_version = "8.0.0",
122-
version = "12.2.0",
123126
use_default_package = True,
127+
version = "12.2.0",
124128
)
125129

126-
# TODO: Not yet supported
127-
# *******************************************************************************
128-
# Setting local host GCC (CPU:x86_64|OS:Linux|V:unknown|ES:host)
129-
# *******************************************************************************
130-
# gcc.toolchain(
131-
# name = "score_system_toolchain",
132-
# target_cpu = "x86_64",
133-
# target_os = "linux",
134-
# use_system_toolchain = True,
135-
# )
136-
137130
# *******************************************************************************
138131
# Setting AutoSD 10 GCC (CPU:x86_64|OS:Linux|V:autosd-10.0|ES:autosd)
139132
# *******************************************************************************
140133
gcc.toolchain(
141134
name = "score_autosd_10_toolchain",
135+
runtime_ecosystem = "autosd",
142136
target_cpu = "x86_64",
143137
target_os = "linux",
144-
runtime_ecosystem = "autosd",
145-
version = "autosd-10.0",
146138
use_default_package = True,
147-
)
139+
version = "14.3.1",
140+
platform_variant = "glibc_2.39",
141+
)
142+
148143

149144
use_repo(
150145
gcc,
151-
"score_gcc_toolchain",
152-
"score_aarch64_gcc_toolchain",
153146
"my_toolchain",
154-
"score_qcc_toolchain",
155-
"score_qcc_arm_toolchain",
147+
"score_aarch64_gcc_toolchain",
156148
"score_autosd_10_toolchain",
157-
)
149+
"score_gcc_toolchain",
150+
"score_qcc_arm_toolchain",
151+
"score_qcc_toolchain",
152+
)

0 commit comments

Comments
 (0)