diff --git a/.bazelrc b/.bazelrc index 51cac5a..0b75026 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,16 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + build --java_language_version=17 build --tool_java_language_version=17 build --java_runtime_version=remotejdk_17 @@ -7,3 +20,6 @@ test --test_output=errors common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ common --registry=https://bcr.bazel.build + +build:gcc --extra_toolchains=@gcc_toolchain//:host_gcc_12 +build:clang --extra_toolchains=@llvm_toolchain//:all diff --git a/MODULE.bazel b/MODULE.bazel index a4633b8..0bb22b6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -35,7 +35,26 @@ llvm.toolchain( use_repo(llvm, "llvm_toolchain") use_repo(llvm, "llvm_toolchain_llvm") -register_toolchains("@llvm_toolchain//:all") +# GCC Toolchain Rules - host configuration +bazel_dep(name = "score_toolchains_gcc", version = "0.1") +gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc") +gcc.toolchain( + url = "https://github.com/eclipse-score/toolchains_gcc/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", + sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", + strip_prefix = "x86_64-unknown-linux-gnu", +) +gcc.extra_features( + features = [ + "minimal_warnings", + "treat_warnings_as_errors", + ], +) +gcc.warning_flags( + minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations"], + strict_warnings = ["-Wextra", "-Wpedantic"], + treat_warnings_as_errors = ["-Werror"], +) +use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") # Dash license checker bazel_dep(name = "dash_license_checker", version = "0.1.0")