blob: 8a6238777a7197a93758b1e1729874586b83ef8d [file] [log] [blame]
* Copyright (c) Facebook, Inc. and its affiliates.
* 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
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
{namespace apple_library}
{template .soyweb}
{param title: 'apple_library()' /}
{param navid: 'rule_apple_library' /}
{param prettify: true /}
{param description}
An apple_library() rule represents a set of Objective-C/C++ source files.
{param content}
{call buck.rule}
{param status: 'UNFROZEN' /}
{param overview}
An <code>apple_library()</code> rule represents a set of Objective-C/C++/Swift
source files and is similar to a <a href="{ROOT}rule/cxx_library.html"><code>cxx_library()</code> rule</a> with which it shares many
attributes. In addition to those common attributes, <code>apple_library()</code> has a some additional attributes
that are specific to binaries intended to be built using the Apple toolchain.
Note, however, that <code>apple_library()</code> and <code>cxx_library()</code> differ
in the way that they import header files, in order to better accommodate existing conventions.
See the sections for the <code>headers</code> and <code>exported_headers</code> attributes for more details.
Buck enables you to override components of the Apple toolchain with
alternate tools, either from the Xcode search paths or from directories
that you specify.
See {call buckconfig.apple_replacement /} and {call buckconfig.apple_xcode_tool_name_override /} for more information.
{param args}
{call buck.name_arg /}
{call cxx_common.srcs_arg}
{param sample_file_name : 'foo/bar.m' /}
{call cxx_common.platform_srcs_arg /}
{call apple_common.headers_arg /}
{call apple_common.exported_headers_arg /}
{call apple_common.header_path_prefix_arg /}
{call cxx_common.header_namespace_arg /}
{call apple_common.frameworks_arg /}
{call cxx_common.preprocessor_flags_arg /}
{call cxx_common.exported_preprocessor_flags_arg /}
{call cxx_common.compiler_flags_arg /}
{call cxx_common.platform_compiler_flags_arg /}
{call cxx_common.linker_extra_outputs_arg /}
{call cxx_common.linker_flags_arg /}
{call cxx_common.exported_linker_flags_arg /}
{call cxx_common.exported_platform_linker_flags_arg /}
{call apple_common.target_sdk_version /}
{call native_common.preferred_linkage /}
{call native_common.link_style /}
{call native_common.link_whole /}
{call cxx_common.reexport_all_header_dependencies_arg /}
{call cxx_common.exported_deps_arg /}
{call buck.tests_apple_arg /}
{call apple_common.extra_xcode_sources /}
{call apple_common.extra_xcode_files /}
{/param} // close args
{param examples}
{literal}<pre class="prettyprint lang-py">
name = 'MyLibrary',
deps = [
preprocessor_flags = ['-fobjc-arc'],
headers = [
srcs = [
frameworks = [
{/call} // close buck.rule