Skip to content

Commit a1d3996

Browse files
committed
add windows builds to bazel
1 parent 7137b3e commit a1d3996

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.bazelrc

+8-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
build --cxxopt="-std=c++20"
1+
common --enable_platform_specific_config
2+
build --verbose_failures
3+
4+
build:unix --cxxopt="-std=c++20"
5+
6+
build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
7+
build:windows --extra_execution_platforms=//:x64_windows-clang-cl
8+
build:windows --cxxopt='/std:c++20' --host_cxxopt='/std:c++20'

.github/workflows/bazel.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,25 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25+
windows:
26+
runs-on: windows-2025
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
- uses: bazel-contrib/setup-bazel@bbf8fe8b219f642c7f8bc673215f28eb1d9dec51 # v0.10.0
30+
with:
31+
bazelisk-cache: true
32+
disk-cache: ${{ github.workflow }}-${{ runner.os }}
33+
repository-cache: true
34+
- name: Build & Test
35+
run: bazel test //...
2536
macos:
2637
runs-on: macos-latest
2738
steps:
2839
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2940
- uses: bazel-contrib/setup-bazel@bbf8fe8b219f642c7f8bc673215f28eb1d9dec51 # v0.10.0
3041
with:
3142
bazelisk-cache: true
32-
disk-cache: ${{ github.workflow }}
43+
disk-cache: ${{ github.workflow }}-${{ runner.os }}
3344
repository-cache: true
3445
- name: Build & Test
3546
run: bazel test //...
@@ -45,7 +56,7 @@ jobs:
4556
- uses: bazel-contrib/setup-bazel@bbf8fe8b219f642c7f8bc673215f28eb1d9dec51 # v0.10.0
4657
with:
4758
bazelisk-cache: true
48-
disk-cache: ${{ github.workflow }}
59+
disk-cache: ${{ github.workflow }}-${{ runner.os }}
4960
repository-cache: true
5061
- name: Build & Test
5162
run: bazel test //...

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ benchmarks/competitors/servo-url/target
2929

3030
# bazel output
3131
bazel-*
32+
.clwb

BUILD.bazel

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Platform definition for using clang-cl on Windows
2+
platform(
3+
name = "x64_windows-clang-cl",
4+
constraint_values = [
5+
"@platforms//cpu:x86_64",
6+
"@platforms//os:windows",
7+
"@bazel_tools//tools/cpp:clang-cl",
8+
],
9+
)
10+
111
cc_library(
212
name = "ada",
313
srcs = [

0 commit comments

Comments
 (0)