Bazel
This page captures the progress of Bazel for windows on arm.
Status
Bazel changes to enable WoA has been upstreamed and are present on the trunk.
Bazel changes are ported to the 5.1 release branch.
Bazel releases are available from Releases · bazelbuild/bazel
Limitations
Bazelisk (launcher for Bazel) doesn’t yet have support for woa.
Bazel Binaries
Bazel pre-built binaries for woa are available
Building from Source
Bazel can be built from the source and requires an x64 bazel for cross-compilation.
You need Bazel(x64) 5 or later.
bazel build --subcommands --cpu=x64_arm64_windows //src:bazel.exe
This generates a standalone bazel.exe
which is a native arm64 Bazel binary.
Bazel builds generated by CI
Bazel binaries for WoA are published as part of Bazel CI and every commit generates a build.
An example built from an old commit. Replace the commit id with one of the latest to access latest builds.
You might need to explicitly add an exe
suffix to the generated binary to execute it.
Usage
Using the examples provided in https://docs.bazel.build/versions/main/tutorial/cpp.html
For targeting windows/arm64
, the following flag needs to be specified
--cpu=arm64_windows
For native compilation, target CPU is auto-detected and explicit target is not required.
Few examples given below,
Cross compilation
bazel build --subcommands //main:hello-world --cpu=arm64_windows
Native Compilation
bazel build --subcommands //main:hello-world