mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-12-02 10:15:22 +00:00
19 lines
565 B
Python
19 lines
565 B
Python
"""Utility functions for platforms"""
|
|
|
|
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
|
|
|
|
def _host_platform_is_darwin():
|
|
return "@platforms//os:osx" in HOST_CONSTRAINTS
|
|
|
|
def _host_platform_is_linux():
|
|
return "@platforms//os:linux" in HOST_CONSTRAINTS
|
|
|
|
def _host_platform_is_windows():
|
|
return "@platforms//os:windows" in HOST_CONSTRAINTS
|
|
|
|
platform_utils = struct(
|
|
host_platform_is_darwin = _host_platform_is_darwin,
|
|
host_platform_is_linux = _host_platform_is_linux,
|
|
host_platform_is_windows = _host_platform_is_windows,
|
|
)
|