aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/systemlibs/build_defs.bzl.tpl
blob: 3faa46c581418c64ce5d4b63cdd40d9e14e87001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- 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)