From f81a7d7a7ef9c22c6f6e991632d1e0b97225a3d6 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Mon, 6 May 2024 10:17:19 +0200 Subject: [PATCH] Added native info --- reference/tools/meson/mesontoolchain.rst | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/reference/tools/meson/mesontoolchain.rst b/reference/tools/meson/mesontoolchain.rst index f7643bf3209..28162c33a79 100644 --- a/reference/tools/meson/mesontoolchain.rst +++ b/reference/tools/meson/mesontoolchain.rst @@ -257,7 +257,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** @@ -281,6 +281,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 `__ + +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 `__ +from the Meson documentation for more information. + + Objective-C arguments ++++++++++++++++++++++