49 lines
1.2 KiB
Text
49 lines
1.2 KiB
Text
{# Copyright © 2024 Google Inc.
|
|
SPDX-License-Identifier: MIT
|
|
#}
|
|
cc_library(
|
|
name = "{{ name }}",
|
|
srcs = [
|
|
{%- for src in srcs %}
|
|
"{{ src }}",
|
|
{%- endfor %}
|
|
],
|
|
hdrs = [
|
|
{% for hdr in hdrs -%}
|
|
"{{ hdr }}",
|
|
{%- endfor %}
|
|
]
|
|
{%- for include_dir in include_directories %}
|
|
+ glob(["{{ include_dir }}"])
|
|
{%- endfor %}
|
|
,
|
|
{# Tells Bazel to use -isystem for targets that depend on this one,
|
|
which is needed for clients that include package headers with angle brackets.
|
|
#}
|
|
includes = [
|
|
{%- for include_dir in system_include_directories %}
|
|
"{{ include_dir }}"
|
|
{%- endfor %}
|
|
],
|
|
copts = [
|
|
{%- for copt in copts %}
|
|
'{{ copt }}',
|
|
{%- endfor %}
|
|
],
|
|
deps = [
|
|
{%- for dep in deps %}
|
|
"{{ dep }}",
|
|
{%- endfor %}
|
|
],
|
|
target_compatible_with = [
|
|
{%- for target_compat in target_compatible_with %}
|
|
"{{ target_compat }}",
|
|
{%- endfor %}
|
|
],
|
|
visibility = [ "//visibility:public" ],
|
|
{# Bazel doesn't seem to have a 'whole_static_libs'
|
|
option for targets that link against static libs;
|
|
workaround is to specify every static lib as alwaysLink
|
|
#}
|
|
alwayslink = True,
|
|
)
|