Skip to content

Commit

Permalink
bazel: Fix MacOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Aug 30, 2023
1 parent 5f0a430 commit 6f7a131
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +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")

package(
default_visibility = ["//visibility:public"],
Expand Down Expand Up @@ -170,7 +171,10 @@ cc_library(
name = "hwcaps",
srcs = ["src/hwcaps.c"],
copts = C99_FLAGS,
defines = ["HAVE_STRONG_GETAUXVAL"],
defines = selects.with_or({
PLATFORM_OS_MACOS: [],
"//conditions:default": ["HAVE_STRONG_GETAUXVAL"],
}),
includes = INCLUDES,
textual_hdrs = ["include/internal/hwcaps.h"],
deps = [
Expand Down
3 changes: 3 additions & 0 deletions bazel/platforms.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ PLATFORM_CPU_PPC = ("@platforms//cpu:ppc")
PLATFORM_CPU_RISCV32 = ("@platforms//cpu:riscv32")

PLATFORM_CPU_RISCV64 = ("@platforms//cpu:riscv64")


PLATFORM_OS_MACOS = ("@platforms//os:macos")

0 comments on commit 6f7a131

Please sign in to comment.