blob: 2397f60b7f9faf24afffdccbd1eb24f23329471c [file] [log] [blame]
/*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
{namespace native_common}
/***/
{template .link_style}
{call buck.arg}
{param name : 'link_style' /}
{param default: 'static' /}
{param desc}
Determines whether to build and link this rule's dependencies statically or dynamically. Can be
either <code>static</code>, <code>static_pic</code> or <code>shared</code>.
{/param}
{/call}
{/template}
/***/
{template .link_whole}
{call buck.arg}
{param name : 'link_whole' /}
{param default: 'False' /}
{param desc}
On some platforms, the linker may choose to drop objects from libraries if it determines
they may be unused. This parameter causes the linker to always include the entire library
in top-level executables or shared libraries.
{/param}
{/call}
{/template}
/***/
{template .preferred_linkage}
{call buck.arg}
{param name : 'preferred_linkage' /}
{param default: 'any' /}
{param desc}
Controls how a library should be linked.
<dl>
<dt><code>any</code></dt>
<dd>The library will be linked based on its dependents <code>link_style</code>.</dd>
<dt><code>shared</code></dt>
<dd>The library will be always be linked as a shared library.</dd>
<dt><code>static</code></dt>
<dd>The library will be linked as a static library.</dd>
</dl>
Note: since shared libraries re-export its dependencies, depending on multiple shared libraries
which themselves have overlapping static dependencies will cause duplicate symbols.
{/param}
{/call}
{/template}