From 44bee1736e2dc186734cfe06edd4dedb9020eba7 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Tue, 17 Dec 2024 13:35:08 +0000 Subject: [PATCH] [bazel] Use a macro instead of @platforms//os:windows --- BUILD.bazel | 6 +++--- bazel/platforms.bzl | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 2ea5e077..5134c797 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -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"], diff --git a/bazel/platforms.bzl b/bazel/platforms.bzl index 65d9a803..00ef1483 100644 --- a/bazel/platforms.bzl +++ b/bazel/platforms.bzl @@ -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")