Skip to content

Commit

Permalink
[bazel] Use a macro instead of @platforms//os:windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gchatelet committed Dec 17, 2024
1 parent 65b952a commit 44bee17
Show file tree
Hide file tree
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
Expand Up @@ -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"],
Expand All @@ -14,7 +14,7 @@ exports_files(["LICENSE"])
INCLUDES = ["include"]

C99_FLAGS = select({
"@platforms//os:windows": [],
PLATFORM_OS_WINDOWS: [],
"//conditions:default": [
"-Wall",
"-Wextra",
Expand Down Expand Up @@ -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"],
Expand Down
2 changes: 2 additions & 0 deletions bazel/platforms.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 44bee17

Please sign in to comment.