kse-01/tensorflow/third_party/systemlibs/build_defs.bzl.tpl
github-classroom[bot] 1122cdd8b0
Initial commit
2023-10-09 11:37:31 +00:00

32 lines
687 B (Stored with Git LFS)
Smarty

# -*- Python -*-
"""Skylark macros for system libraries.
"""
SYSTEM_LIBS_ENABLED = %{syslibs_enabled}
SYSTEM_LIBS_LIST = [
%{syslibs_list}
]
def if_any_system_libs(a, b=[]):
"""Conditional which evaluates to 'a' if any system libraries are configured."""
if SYSTEM_LIBS_ENABLED:
return a
else:
return b
def if_system_lib(lib, a, b=[]):
"""Conditional which evaluates to 'a' if we're using the system version of lib"""
if SYSTEM_LIBS_ENABLED and lib in SYSTEM_LIBS_LIST:
return a
else:
return b
def if_not_system_lib(lib, a, b=[]):
"""Conditional which evaluates to 'a' if we're using the system version of lib"""
return if_system_lib(lib, b, a)