blob: ebf5bf4a2c03d3fac1fabe1466c169139729957a [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XCODE_LINK_BUILD_PHASE_MODE &mdash; CMake 3.23.1 Documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/cmake.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="XCODE_PRODUCT_TYPE" href="XCODE_PRODUCT_TYPE.html" />
<link rel="prev" title="XCODE_GENERATE_SCHEME" href="XCODE_GENERATE_SCHEME.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="XCODE_PRODUCT_TYPE.html" title="XCODE_PRODUCT_TYPE"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="XCODE_GENERATE_SCHEME.html" title="XCODE_GENERATE_SCHEME"
accesskey="P">previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.23.1 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" accesskey="U">cmake-properties(7)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">XCODE_LINK_BUILD_PHASE_MODE</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="xcode-link-build-phase-mode">
<span id="prop_tgt:XCODE_LINK_BUILD_PHASE_MODE"></span><h1>XCODE_LINK_BUILD_PHASE_MODE<a class="headerlink" href="#xcode-link-build-phase-mode" title="Permalink to this headline">ΒΆ</a></h1>
<div class="versionadded">
<p><span class="versionmodified added">New in version 3.19.</span></p>
</div>
<p>When using the <span class="target" id="index-0-generator:Xcode"></span><a class="reference internal" href="../generator/Xcode.html#generator:Xcode" title="Xcode"><code class="xref cmake cmake-generator docutils literal notranslate"><span class="pre">Xcode</span></code></a> generator, libraries to be linked will be
specified in the Xcode project file using either the &quot;Link Binary With
Libraries&quot; build phase or directly as linker flags. The former allows Xcode
to manage build paths, which may be necessary when creating Xcode archives
because it may use different build paths to a regular build.</p>
<p>This property controls usage of &quot;Link Binary With Libraries&quot; build phase for
a target that is an app bundle, executable, shared library, shared framework
or a module library.</p>
<p>Possible values are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">NONE</span></code>
The libraries will be linked by specifying the linker flags directly.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">BUILT_ONLY</span></code>
The &quot;Link Binary With Libraries&quot; build phase will be used to link to another
target under the following conditions:</p>
<ul>
<li><p>The target to be linked to is a regular non-imported, non-interface library
target.</p></li>
<li><p>The output directory of the target being built has not been changed from
its default (see <span class="target" id="index-0-prop_tgt:RUNTIME_OUTPUT_DIRECTORY"></span><a class="reference internal" href="RUNTIME_OUTPUT_DIRECTORY.html#prop_tgt:RUNTIME_OUTPUT_DIRECTORY" title="RUNTIME_OUTPUT_DIRECTORY"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">RUNTIME_OUTPUT_DIRECTORY</span></code></a> and
<span class="target" id="index-0-prop_tgt:LIBRARY_OUTPUT_DIRECTORY"></span><a class="reference internal" href="LIBRARY_OUTPUT_DIRECTORY.html#prop_tgt:LIBRARY_OUTPUT_DIRECTORY" title="LIBRARY_OUTPUT_DIRECTORY"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">LIBRARY_OUTPUT_DIRECTORY</span></code></a>).</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">KNOWN_LOCATION</span></code>
The &quot;Link Binary With Libraries&quot; build phase will be used to link to another
target under the same conditions as with <code class="docutils literal notranslate"><span class="pre">BUILT_ONLY</span></code> and also:</p>
<ul>
<li><p>Imported library targets except those of type <code class="docutils literal notranslate"><span class="pre">UNKNOWN</span></code>.</p></li>
<li><p>Any non-target library specified directly with a path.</p></li>
</ul>
</li>
</ul>
<p>For all other cases, the libraries will be linked by specifying the linker
flags directly.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Libraries linked using &quot;Link Binary With Libraries&quot; are linked after the
ones linked through regular linker flags. This order should be taken into
account when different static libraries contain symbols with the same name,
as the former ones will take precedence over the latter.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>If two or more directories contain libraries with identical file names and
some libraries are linked from those directories, the library search path
lookup will end up linking libraries from the first directory. This is a
known limitation of Xcode.</p>
</div>
<p>This property is initialized by the value of the
<span class="target" id="index-0-variable:CMAKE_XCODE_LINK_BUILD_PHASE_MODE"></span><a class="reference internal" href="../variable/CMAKE_XCODE_LINK_BUILD_PHASE_MODE.html#variable:CMAKE_XCODE_LINK_BUILD_PHASE_MODE" title="CMAKE_XCODE_LINK_BUILD_PHASE_MODE"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_XCODE_LINK_BUILD_PHASE_MODE</span></code></a> variable if it is set when a
target is created.</p>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="XCODE_GENERATE_SCHEME.html"
title="previous chapter">XCODE_GENERATE_SCHEME</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="XCODE_PRODUCT_TYPE.html"
title="next chapter">XCODE_PRODUCT_TYPE</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="XCODE_PRODUCT_TYPE.html" title="XCODE_PRODUCT_TYPE"
>next</a> |</li>
<li class="right" >
<a href="XCODE_GENERATE_SCHEME.html" title="XCODE_GENERATE_SCHEME"
>previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.23.1 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" >cmake-properties(7)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">XCODE_LINK_BUILD_PHASE_MODE</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2022 Kitware, Inc. and Contributors.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
</div>
</body>
</html>