From 7960c4bd25b5ca68c705c1b1502d9664c856e1c0 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 20 Jul 2022 10:02:43 +0200 Subject: [PATCH 1/7] Added default dirs and objective-c information --- .../conanfile/tools/meson/mesontoolchain.rst | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index 6333a4e938c..7b1f422fbf9 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -116,6 +116,50 @@ The ``MesonToolchain`` only works with the ``PkgConfigDeps`` generator. Please, do not use other generators, as they can have overlapping definitions that can conflict. +Default directories ++++++++++++++++++++++ + +Since Conan 1.51, ``MesonToolchain`` manages some of the directories used by Meson. They are `conan_meson_*.ini` +variables declared under the ``[project options]`` section +(see more information about `Meson directories `__): + + +``bindir``: value coming from ``self.cpp.package.bindirs``. Defaulted to None. +``sbindir``: value coming from ``self.cpp.package.bindirs``. Defaulted to None. +``libexecdir``: value coming from ``self.cpp.package.bindirs``. Defaulted to None. +``datadir``: value coming from ``self.cpp.package.resdirs``. Defaulted to None. +``localedir``: value coming from ``self.cpp.package.resdirs``. Defaulted to None. +``mandir``: value coming from ``self.cpp.package.resdirs``. Defaulted to None. +``infodir``: value coming from ``self.cpp.package.resdirs``. Defaulted to None. +``includedir``: value coming from ``self.cpp.package.includedirs``. Defaulted to None. +``libdir``: value coming from ``self.cpp.package.libdirs``. Defaulted to None. + +Notice that it needs a ``layout`` to be able to initialize those ``self.cpp.package.xxxxx`` variables. For instance: + +.. code:: python + + from conan import ConanFile + from conan.tools.meson import MesonToolchain + + class App(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + self.folders.build = "build" + self.cpp.package.resdirs = ["res"] + + def generate(self): + tc = MesonToolchain(self) + print(tc.project_options["datadir"]) # Will print '["res"]' + tc.generate() + + +.. note:: + + All of them are saved only if they have any value. If the values is ``None``, they won't be mentioned + in ``[project options]`` section. + + Using the toolchain in developer flow +++++++++++++++++++++++++++++++++++++ @@ -200,3 +244,15 @@ to the ``MesonToolchain`` class interface. For instance: tc = MesonToolchain(self) tc.cpp = "/path/to/other/compiler" tc.generate() + + +Objective-C arguments +++++++++++++++++++++++ + +Since Conan 1.51, it's been introduced some specific Objective-C arguments: ``objc``, ``objcpp``, ``objc_args``, +``objc_link_args``, ``objcpp_args``, and ``objcpp_link_args``, as public attributes of the ``MesonToolchain`` class, where +``objc = "clang"`` and ``objcpp = "clang++"`` by default. + +.. note:: + + They will be only initialized if the OS used belongs to any of the Apple ones. From 5c3fa08a73a6e7310c7dcee4947646482e1346c1 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 20 Jul 2022 10:08:08 +0200 Subject: [PATCH 2/7] Improved sentence --- reference/conanfile/tools/meson/mesontoolchain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index 7b1f422fbf9..cc4511ae37a 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -251,7 +251,7 @@ Objective-C arguments Since Conan 1.51, it's been introduced some specific Objective-C arguments: ``objc``, ``objcpp``, ``objc_args``, ``objc_link_args``, ``objcpp_args``, and ``objcpp_link_args``, as public attributes of the ``MesonToolchain`` class, where -``objc = "clang"`` and ``objcpp = "clang++"`` by default. +the variables ``objc`` and ``objcpp`` are initialized as ``clang`` and ``clang++`` respectively by default. .. note:: From a1fbcadae4efd98ee7b77969c02bb7e5560435a6 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 20 Jul 2022 10:10:51 +0200 Subject: [PATCH 3/7] complete conan files names --- reference/conanfile/tools/meson/mesontoolchain.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index cc4511ae37a..931777bc678 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -119,8 +119,8 @@ Please, do not use other generators, as they can have overlapping definitions th Default directories +++++++++++++++++++++ -Since Conan 1.51, ``MesonToolchain`` manages some of the directories used by Meson. They are `conan_meson_*.ini` -variables declared under the ``[project options]`` section +Since Conan 1.51, ``MesonToolchain`` manages some of the directories used by Meson. They are `conan_meson_native.ini` +and `conan_meson_cross.ini` variables declared under the ``[project options]`` section (see more information about `Meson directories `__): From 4c2000264c0dc2486fc668846718783ef0e11e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ram=C3=ADrez?= Date: Wed, 20 Jul 2022 10:41:05 +0200 Subject: [PATCH 4/7] Update reference/conanfile/tools/meson/mesontoolchain.rst Co-authored-by: SSE4 --- reference/conanfile/tools/meson/mesontoolchain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index 931777bc678..b8e568ba761 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -249,7 +249,7 @@ to the ``MesonToolchain`` class interface. For instance: Objective-C arguments ++++++++++++++++++++++ -Since Conan 1.51, it's been introduced some specific Objective-C arguments: ``objc``, ``objcpp``, ``objc_args``, +Since Conan 1.51, it's been introduced some specific Objective-C/Objective-C++ arguments: ``objc``, ``objcpp``, ``objc_args``, ``objc_link_args``, ``objcpp_args``, and ``objcpp_link_args``, as public attributes of the ``MesonToolchain`` class, where the variables ``objc`` and ``objcpp`` are initialized as ``clang`` and ``clang++`` respectively by default. From 8401c5ee4eadc7f2e42623b1651c7723cf9152f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ram=C3=ADrez?= Date: Wed, 20 Jul 2022 10:41:10 +0200 Subject: [PATCH 5/7] Update reference/conanfile/tools/meson/mesontoolchain.rst Co-authored-by: SSE4 --- reference/conanfile/tools/meson/mesontoolchain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index b8e568ba761..5e104f8cc90 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -156,7 +156,7 @@ Notice that it needs a ``layout`` to be able to initialize those ``self.cpp.pack .. note:: - All of them are saved only if they have any value. If the values is ``None``, they won't be mentioned + All of them are saved only if they have any value. If the values are``None``, they won't be mentioned in ``[project options]`` section. From 00fd50e02d16172741689b91112458c9aadf9185 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 20 Jul 2022 11:32:00 +0200 Subject: [PATCH 6/7] output.info --- reference/conanfile/tools/meson/mesontoolchain.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index 5e104f8cc90..6c78cc2b75c 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -150,7 +150,7 @@ Notice that it needs a ``layout`` to be able to initialize those ``self.cpp.pack def generate(self): tc = MesonToolchain(self) - print(tc.project_options["datadir"]) # Will print '["res"]' + self.output.info(tc.project_options["datadir"]) # Will print '["res"]' tc.generate() From 986ea9c3c8a4d511eb3300d4ac2333e4fc094b21 Mon Sep 17 00:00:00 2001 From: Luis Date: Thu, 28 Jul 2022 09:44:56 +0200 Subject: [PATCH 7/7] rewrite sentece --- reference/conanfile/tools/meson/mesontoolchain.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/conanfile/tools/meson/mesontoolchain.rst b/reference/conanfile/tools/meson/mesontoolchain.rst index 6c78cc2b75c..7a7ef556603 100644 --- a/reference/conanfile/tools/meson/mesontoolchain.rst +++ b/reference/conanfile/tools/meson/mesontoolchain.rst @@ -119,8 +119,8 @@ Please, do not use other generators, as they can have overlapping definitions th Default directories +++++++++++++++++++++ -Since Conan 1.51, ``MesonToolchain`` manages some of the directories used by Meson. They are `conan_meson_native.ini` -and `conan_meson_cross.ini` variables declared under the ``[project options]`` section +Since Conan 1.51, ``MesonToolchain`` manages some of the directories used by Meson. These are variables declared under +the ``[project options]`` section of the files `conan_meson_native.ini` and `conan_meson_cross.ini` (see more information about `Meson directories `__):