kse-01/tensorflow/third_party/systemlibs/build_defs.bzl.tpl

33 lines
687 B
Smarty
Raw Normal View History

2023-10-09 11:37:31 +00:00
# -*- 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)