1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 07:02:30 +02:00

[bazel] Use a macro instead of @platforms//os:windows

This commit is contained in:
Guillaume Chatelet 2024-12-17 13:35:08 +00:00
parent 65b952aff1
commit 44bee1736e
2 changed files with 5 additions and 3 deletions

View File

@ -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"],

View File

@ -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")