Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bazel windows support #376

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
33 changes: 33 additions & 0 deletions .github/workflows/amd64_windows_bazel.yml
Original file line number Diff line number Diff line change
@@ -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
...
31 changes: 19 additions & 12 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading