Integrating conan with meson via a module. #12762
Replies: 6 comments 4 replies
-
I'm not exactly sure what you're asking for, here. Do you mean that meson should configure the project, collect each This fundamentally cannot work, for a few different reasons but especially because the detected version of a dependency can be read in a meson.build and used as a conditional rule for any other meson code, including "choose which other dependencies to look for". So the dependencies need to be fully resolved immediately as soon as |
Beta Was this translation helpful? Give feedback.
-
There's really only two ways I could see to achieve this:
One of these sounds a lot harder than the other way. |
Beta Was this translation helpful? Give feedback.
-
A proposal I would like to make that would also be useful for vcpkg: integrating conan or any dependency provider (but out of scope in my case, I would only work on integrating conan) in expressions such as
This already works for wraps and fallbacks. It should not be important what happens under the hood as long as:
The way I imagine, because I do not know it is even possible, is to make it work transparently and be able to have dependency providers as transparent as possible but selectable, as of now. So this would amount to use a conan provider. In the conan case the profile files would be generated from the meson toolchain files directly. What do you think as a first idea? |
Beta Was this translation helpful? Give feedback.
-
Following the discussion on what I said above. Just wild ideas so far. I would be grateful to get feedback to rely on a design that is potentially useful for plugging other providers and with some consensus in case I start an implementation. I would also like that it is potentially useful to plug in other providers. How about extending wraps?
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am currently exploring the possibility of creating an alternative build system for Node.js native addons with WASM support and I have the same problems - I also need conan with multiplatform support - and I need the possibility of auto-loading native and cross files depending on the environment. As far as I know there is no way to auto-load native and cross files - the user must build the list one the command line. Frankly, I wonder if there shouldn't be another super tool that handles conan, meson, builds a list of native and cross files and handles the automatic download of precompiled binaries if these are available. This would be an evolution of @bruchar1 option 3. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I would like to discuss an idea about integration with Conan that came out in one of my projects.
Currently, I am using Meson together with conan for multiplatform support.
Conan has good support for Meson via https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html. It also generates a toolchain file via https://docs.conan.io/2/reference/tools/meson/mesontoolchain.html#conan-tools-meson-mesontoolchain.
The problem from the point of view of my project is that in Conan they recommend a two-step process that is non-invasive for Meson:
pkg_config_path
After that, you can do something like this:
This is good as long as you do not have a project that generates dependencies conditionally. If the dependencies of the Meson project are conditional, you cannot do a first stand-alone conan step. It will just not work. But I want to keep dependencies to the strictly needed. For that I need the setup step to detect dependencies and add them to a
conanfile.txt
that is generated duringmeson setup --native-file myfile.ini
.This means that the toolchain file for Meson from conan cannot be generated. It should be exactly the opposite:
Once the configuration is done, two things should be done:
Namely, in this model, meson toolchain files + dependencies detection is the model by which the build is driven and conan is invoked to obtain those dependencies.
I would propose to figure out a module that can:
This way all the dependencies generation + conan would be integrated transparently.
Beta Was this translation helpful? Give feedback.
All reactions