Skip to content

Commit

Permalink
[BUILD] Add abi_version_no bazel flag. (#3020)
Browse files Browse the repository at this point in the history
  • Loading branch information
BYVoid authored Aug 6, 2024
1 parent 34ca855 commit 7c6b9db
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion api/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "string_flag")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -35,6 +35,9 @@ cc_library(
":set_cxx_stdlib_2020": ["OPENTELEMETRY_STL_VERSION=2020"],
":set_cxx_stdlib_2023": ["OPENTELEMETRY_STL_VERSION=2023"],
"//conditions:default": [],
}) + select({
":abi_version_no_1": ["OPENTELEMETRY_ABI_VERSION_NO=1"],
":abi_version_no_2": ["OPENTELEMETRY_ABI_VERSION_NO=2"],
}),
strip_include_prefix = "include",
tags = ["api"],
Expand All @@ -61,3 +64,18 @@ bool_flag(
build_setting_default = False,
deprecation = "The value of this flag is ignored. Bazel builds always depend on Abseil for its pre-adopted `std::` types. You should remove this flag from your build command.",
)

int_flag(
name = "abi_version_no",
build_setting_default = 1,
)

config_setting(
name = "abi_version_no_1",
flag_values = {":abi_version_no": "1"},
)

config_setting(
name = "abi_version_no_2",
flag_values = {":abi_version_no": "2"},
)

1 comment on commit 7c6b9db

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 7c6b9db Previous: 34ca855 Ratio
BM_BaselineBuffer/1 15349345.207214355 ns/iter 5057640.075683594 ns/iter 3.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.