Skip to content

Commit 4f45bf2

Browse files
authored
Merge pull request google#379 from google/fix_windows_platform
[bazel] Use a macro instead of @platforms//os:windows
2 parents 65b952a + 44bee17 commit 4f45bf2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
load("@bazel_skylib//lib:selects.bzl", "selects")
44
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")
5-
load("//:bazel/platforms.bzl", "PLATFORM_OS_MACOS", "PLATFORM_OS_LINUX", "PLATFORM_OS_FREEBSD", "PLATFORM_OS_OPENBSD", "PLATFORM_OS_ANDROID")
5+
load("//:bazel/platforms.bzl", "PLATFORM_OS_MACOS", "PLATFORM_OS_LINUX", "PLATFORM_OS_FREEBSD", "PLATFORM_OS_OPENBSD", "PLATFORM_OS_ANDROID", "PLATFORM_OS_WINDOWS")
66

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

1616
C99_FLAGS = select({
17-
"@platforms//os:windows": [],
17+
PLATFORM_OS_WINDOWS: [],
1818
"//conditions:default": [
1919
"-Wall",
2020
"-Wextra",
@@ -394,7 +394,7 @@ cc_library(
394394
copts = C99_FLAGS,
395395
includes = INCLUDES + ["ndk_compat"],
396396
target_compatible_with = select({
397-
"@platforms//os:windows": ["@platforms//:incompatible"],
397+
PLATFORM_OS_WINDOWS: ["@platforms//:incompatible"],
398398
"//conditions:default": [],
399399
}),
400400
textual_hdrs = ["ndk_compat/cpu-features.h"],

bazel/platforms.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ PLATFORM_OS_ANDROID = ("@platforms//os:android")
2424
PLATFORM_OS_FREEBSD = ("@platforms//os:freebsd")
2525

2626
PLATFORM_OS_OPENBSD = ("@platforms//os:openbsd")
27+
28+
PLATFORM_OS_WINDOWS = ("@platforms//os:windows")

0 commit comments

Comments
 (0)