diff --git a/.github/workflows/amd64_windows_bazel.yml b/.github/workflows/amd64_windows_bazel.yml
new file mode 100644
index 00000000..184a0df0
--- /dev/null
+++ b/.github/workflows/amd64_windows_bazel.yml
@@ -0,0 +1,33 @@
+# ref: https://github.com/actions/runner-images
+name: amd64 Windows Bazel
+
+on:
+ push:
+ pull_request:
+ schedule:
+ # min hours day(month) month day(week)
+ - cron: '0 0 7,22 * *'
+
+jobs:
+ # Building using the github runner environement directly.
+ bazel:
+ runs-on: windows-latest
+ steps:
+ - name: Check out repository code
+ uses: actions/checkout@v4
+ - name: Install Bazel
+ run: |
+ choco install bazel
+ bazel version
+ - name: Build
+ run: >
+ bazel build
+ -c opt
+ --subcommands=true
+ ...
+ - name: Test
+ run: >
+ bazel test
+ -c opt
+ --test_output=errors
+ ...
diff --git a/BUILD.bazel b/BUILD.bazel
index 24cb9e08..2ea5e077 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -13,18 +13,21 @@ exports_files(["LICENSE"])
INCLUDES = ["include"]
-C99_FLAGS = [
- "-Wall",
- "-Wextra",
- "-Wmissing-declarations",
- "-Wmissing-prototypes",
- "-Wno-implicit-fallthrough",
- "-Wno-unused-function",
- "-Wold-style-definition",
- "-Wshadow",
- "-Wsign-compare",
- "-Wstrict-prototypes",
-]
+C99_FLAGS = select({
+ "@platforms//os:windows": [],
+ "//conditions:default": [
+ "-Wall",
+ "-Wextra",
+ "-Wmissing-declarations",
+ "-Wmissing-prototypes",
+ "-Wno-implicit-fallthrough",
+ "-Wno-unused-function",
+ "-Wold-style-definition",
+ "-Wshadow",
+ "-Wsign-compare",
+ "-Wstrict-prototypes",
+ ],
+})
cc_library(
name = "cpu_features_macros",
@@ -390,6 +393,10 @@ cc_library(
srcs = ["ndk_compat/cpu-features.c"],
copts = C99_FLAGS,
includes = INCLUDES + ["ndk_compat"],
+ target_compatible_with = select({
+ "@platforms//os:windows": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
textual_hdrs = ["ndk_compat/cpu-features.h"],
deps = [
":cpu_features_macros",
diff --git a/README.md b/README.md
index 36f1be5a..417fa1ce 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ instructions) at runtime.
| | Linux | FreeBSD | MacOS | Windows |
| :-- | --: | --: | --: | --: |
-| amd64 | [![CMake][i1a0]][l1a0]
[![Bazel][i1a1]][l1a1] | ![CMake][d0]
![Bazel][d1] | [![CMake][i3a0]][l3a0]
[![Bazel][i3a1]][l3a1] | [![CMake][i4a0]][l4a0]
![Bazel][d1] |
+| amd64 | [![CMake][i1a0]][l1a0]
[![Bazel][i1a1]][l1a1] | ![CMake][d0]
![Bazel][d1] | [![CMake][i3a0]][l3a0]
[![Bazel][i3a1]][l3a1] | [![CMake][i4a0]][l4a0]
[![Bazel][i4a1]][l4a1] |
| AArch64 | [![CMake][i1b0]][l1b0]
[![Bazel][i1b1]][l1b1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] |
| ARM | [![CMake][i1c0]][l1c0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] |
| MIPS | [![CMake][i1d0]][l1d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] | ![CMake][d0]
![Bazel][d1] |
@@ -32,6 +32,7 @@ instructions) at runtime.
[i3a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_macos_cmake.yml?branch=main&event=push&label=&logo=cmake
[i3a1]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_macos_bazel.yml?branch=main&event=push&label=&logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNiAuMTZsNS43ODYgNS43ODZMNiAxMS43MzIuMjE0IDUuOTQ2IDYgLjE2MXpNMCA2LjIxNFYxMmw1Ljc4NiA1Ljc4NlYxMkwwIDYuMjE0ek0xOCAuMTZsNS43ODYgNS43ODZMMTggMTEuNzMybC01Ljc4Ni01Ljc4NkwxOCAuMTYxek0yNCA2LjIxNFYxMmwtNS43ODYgNS43ODZWMTJMMjQgNi4yMTR6TTEyIDYuMTZsNS43ODYgNS43ODZMMTIgMTcuNzMybC01Ljc4Ni01Ljc4NkwxMiA2LjE2MXpNMTEuODQgMTguMDU0djUuNzg1bC01Ljc4Ni01Ljc4NXYtNS43ODZsNS43ODUgNS43ODZ6TTEyLjE2IDE4LjA1NGw1Ljc4Ni01Ljc4NnY1Ljc4NmwtNS43ODUgNS43ODV2LTUuNzg1eiIgc3Ryb2tlPSJ0cmFuc3BhcmVudCIgZmlsbD0id2hpdGUiLz48L3N2Zz4=
[i4a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_windows_cmake.yml?branch=main&event=push&label=&logo=cmake
+[i4a1]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_windows_bazel.yml?branch=main&event=push&label=&logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNiAuMTZsNS43ODYgNS43ODZMNiAxMS43MzIuMjE0IDUuOTQ2IDYgLjE2MXpNMCA2LjIxNFYxMmw1Ljc4NiA1Ljc4NlYxMkwwIDYuMjE0ek0xOCAuMTZsNS43ODYgNS43ODZMMTggMTEuNzMybC01Ljc4Ni01Ljc4NkwxOCAuMTYxek0yNCA2LjIxNFYxMmwtNS43ODYgNS43ODZWMTJMMjQgNi4yMTR6TTEyIDYuMTZsNS43ODYgNS43ODZMMTIgMTcuNzMybC01Ljc4Ni01Ljc4NkwxMiA2LjE2MXpNMTEuODQgMTguMDU0djUuNzg1bC01Ljc4Ni01Ljc4NXYtNS43ODZsNS43ODUgNS43ODZ6TTEyLjE2IDE4LjA1NGw1Ljc4Ni01Ljc4NnY1Ljc4NmwtNS43ODUgNS43ODV2LTUuNzg1eiIgc3Ryb2tlPSJ0cmFuc3BhcmVudCIgZmlsbD0id2hpdGUiLz48L3N2Zz4=
[l1a0]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_cmake.yml
[l1a1]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_bazel.yml
[l1b0]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux_cmake.yml
@@ -44,6 +45,7 @@ instructions) at runtime.
[l3a0]: https://github.com/google/cpu_features/actions/workflows/amd64_macos_cmake.yml
[l3a1]: https://github.com/google/cpu_features/actions/workflows/amd64_macos_bazel.yml
[l4a0]: https://github.com/google/cpu_features/actions/workflows/amd64_windows_cmake.yml
+[l4a1]: https://github.com/google/cpu_features/actions/workflows/amd64_windows_bazel.yml
## Table of Contents