Skip to content

Commit

Permalink
Added native info (#3710)
Browse files Browse the repository at this point in the history
  • Loading branch information
franramirez688 committed May 6, 2024
1 parent 00c0e5e commit 0d12266
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion reference/tools/meson/mesontoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ as it can result in unexpected errors during your project's build process.
Cross-building for Apple and Android
-------------------------------------

The ``MesonToolchain`` adds all the flags required to cross-compile for Apple (MacOS M1, iOS, etc.) and Android.
The ``MesonToolchain`` generator adds all the flags required to cross-compile for Apple (MacOS M1, iOS, etc.) and Android.

**Apple**

Expand All @@ -282,6 +282,30 @@ in this example of host profile:
[conf]
tools.apple:sdk_path=/my/path/to/iPhoneOS.sdk
Cross-building and native=true
------------------------------

New since `Conan 2.3.0 <https://github.com/conan-io/conan/releases/tag/2.3.0>`__

When you are cross-building, sometimes you need to build a tool which is used to generate source files.
For this you would want to build some targets with the system's native compiler. Then, you need Conan to create both
context files:

.. code:: python
def generate(self):
tc = MesonToolchain(self)
tc.generate()
# Forcing to create the native context too
if cross_building(self):
tc = MesonToolchain(self, native=True)
tc.generate()
See also `this reference <https://mesonbuild.com/Cross-compilation.html#mixing-host-and-build-targets>`__
from the Meson documentation for more information.


Objective-C arguments
++++++++++++++++++++++

Expand Down

0 comments on commit 0d12266

Please sign in to comment.