Skip to content

Commit

Permalink
Merge pull request #379 from google/fix_windows_platform
Browse files Browse the repository at this point in the history
[bazel] Use a macro instead of @platforms//os:windows
  • Loading branch information
gchatelet authored Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 65b952a + 44bee17 commit 4f45bf2
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

load("@bazel_skylib//lib:selects.bzl", "selects")
load("//:bazel/platforms.bzl", "PLATFORM_CPU_ARM", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_MIPS", "PLATFORM_CPU_PPC", "PLATFORM_CPU_RISCV32", "PLATFORM_CPU_RISCV64", "PLATFORM_CPU_X86_64")
load("//:bazel/platforms.bzl", "PLATFORM_OS_MACOS", "PLATFORM_OS_LINUX", "PLATFORM_OS_FREEBSD", "PLATFORM_OS_OPENBSD", "PLATFORM_OS_ANDROID")
load("//:bazel/platforms.bzl", "PLATFORM_OS_MACOS", "PLATFORM_OS_LINUX", "PLATFORM_OS_FREEBSD", "PLATFORM_OS_OPENBSD", "PLATFORM_OS_ANDROID", "PLATFORM_OS_WINDOWS")

package(
default_visibility = ["//visibility:public"],
@@ -14,7 +14,7 @@ exports_files(["LICENSE"])
INCLUDES = ["include"]

C99_FLAGS = select({
"@platforms//os:windows": [],
PLATFORM_OS_WINDOWS: [],
"//conditions:default": [
"-Wall",
"-Wextra",
@@ -394,7 +394,7 @@ cc_library(
copts = C99_FLAGS,
includes = INCLUDES + ["ndk_compat"],
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
PLATFORM_OS_WINDOWS: ["@platforms//:incompatible"],
"//conditions:default": [],
}),
textual_hdrs = ["ndk_compat/cpu-features.h"],
2 changes: 2 additions & 0 deletions bazel/platforms.bzl
Original file line number Diff line number Diff line change
@@ -24,3 +24,5 @@ PLATFORM_OS_ANDROID = ("@platforms//os:android")
PLATFORM_OS_FREEBSD = ("@platforms//os:freebsd")

PLATFORM_OS_OPENBSD = ("@platforms//os:openbsd")

PLATFORM_OS_WINDOWS = ("@platforms//os:windows")

0 comments on commit 4f45bf2

Please sign in to comment.