Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4.1
3 changes: 3 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: [pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
Expand All @@ -17,3 +18,5 @@ jobs:
working-directory: test
- run: bazelisk test ... [email protected]//:ssl=boringssl
working-directory: test
- run: bazelisk test ... [email protected]//:ssl=openssl
working-directory: test
70 changes: 44 additions & 26 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_library")

string_flag(
name = "ssl",
visibility = ["//visibility:public"],
values = ["no_ssl", "openssl", "boringssl"],
build_setting_default = "no_ssl",
values = [
"no_ssl",
"boringssl",
"openssl",
],
visibility = ["//visibility:public"],
)

config_setting(
name = "no_ssl",
flag_values = {":ssl": "no_ssl"},
)

config_setting(name = "no_ssl", flag_values = {":ssl": "no_ssl"})
config_setting(name = "openssl", flag_values = {":ssl": "openssl"})
config_setting(name = "boringssl", flag_values = {":ssl": "boringssl"})
config_setting(
name = "boringssl",
flag_values = {":ssl": "boringssl"},
)

config_setting(
name = "openssl",
flag_values = {":ssl": "openssl"},
)

write_file(
name = "src",
Expand All @@ -29,25 +44,6 @@ write_file(

cc_library(
name = "boost.asio",
visibility = ["//visibility:public"],
defines = ["BOOST_ASIO_SEPARATE_COMPILATION"],
linkopts = select({
"@platforms//os:windows": [
"-DEFAULTLIB:ws2_32",
"-DEFAULTLIB:mswsock",
],
"//conditions:default": [
"-lpthread",
],
}),
hdrs = glob([
"include/**/*.hpp",
"include/**/*.h",
"include/**/*.ipp",
], exclude = [
"include/boost/asio/impl/src.hpp",
"include/boost/asio/ssl/impl/src.hpp",
]),
srcs = [":src"] + select({
":no_ssl": [
"include/boost/asio/impl/src.hpp",
Expand All @@ -57,7 +53,29 @@ cc_library(
"include/boost/asio/ssl/impl/src.hpp",
],
}),
hdrs = glob(
[
"include/**/*.hpp",
"include/**/*.h",
"include/**/*.ipp",
],
exclude = [
"include/boost/asio/impl/src.hpp",
"include/boost/asio/ssl/impl/src.hpp",
],
),
defines = ["BOOST_ASIO_SEPARATE_COMPILATION"],
includes = ["include"],
linkopts = select({
"@platforms//os:windows": [
"-DEFAULTLIB:ws2_32",
"-DEFAULTLIB:mswsock",
],
"//conditions:default": [
"-lpthread",
],
}),
visibility = ["//visibility:public"],
deps = [
"@boost.align",
"@boost.array",
Expand All @@ -78,8 +96,8 @@ cc_library(
"@boost.type_traits",
"@boost.utility",
] + select({
":openssl": ["@openssl//:ssl"],
":boringssl": ["@boringssl//:ssl"],
":openssl": ["@openssl//:ssl"],
":no_ssl": [],
}),
)
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ bazel_dep(name = "boost.system", version = "1.83.0.bzl.2")
bazel_dep(name = "boost.throw_exception", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.type_traits", version = "1.83.0.bzl.1")
bazel_dep(name = "boost.utility", version = "1.83.0.bzl.1")
bazel_dep(name = "openssl", version = "3.3.1.bcr.1")

Choose a reason for hiding this comment

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

Suggested change
bazel_dep(name = "openssl", version = "3.3.1.bcr.1")
bazel_dep(name = "openssl", version = "3.3.1.bcr.2")

We just released Windows support - hopefully this change should make things work! (Huge thanks to @andrewkatson for doing all of the hard work here!)

1 change: 1 addition & 0 deletions test/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4.1
Loading