Replies: 2 comments 1 reply
-
It is best when the config-tool supports --version, --cflags, --libs as it can be supported as a drop-in. That's the only one I can really see being allowed as a user-defined config-tool. Some of them are cursed and want --ldflags, --cppflags... Some of them are cursed and don't support a --version flag so we have to guess by using the --cflags value to figure out where the header is to extract a version from the header using cc.get_define or worse. MPI uses hdf5 uses llvm uses --cppflags, but also needs --components to handle the Qt invented their own config-tool called qmake, and you run it as JSON is completely out of the question. No known config tools emit that and we don't want people to write any -- people should be distributing pkg-config files instead, which are already a well-defined interface. |
Beta Was this translation helpful? Give feedback.
-
I made a PR for this at #13660, for further discussion. |
Beta Was this translation helpful? Give feedback.
-
There are a number of frameworks/libraries/etc that export their build settings via a config-tool style of interface, as evidenced by meson having builtin support for a number of them (cups, hdf5, llvm, ... seems like quite a few).
It seems that meson's philosophy is to make it easy for users to use external dependencies that have weird requirements by building support for them out of the box. This is effective for anything that is popular enough to merit special handling, but for things that aren't particularly popular it probably doesn't make a bunch of sense to build custom support for that library in meson.
My proposal would be to allow the following sort of thing to work:
The executable program passed as the method would be required to support some standard as documented in the meson manual. Probably this standard would look very similar to how the other config tools work -- or maybe it would be something completely different like output json to reduce the number of calls needed to the executable. In any case, having a way to interface with other configuration tools would make it easier to integrate with other dependency systems without needing to modify the meson core.
In theory, the custom config tool could download a dependency when it gets executed, but that would probably be abusing this feature. If that sort of thing was desirable then we'd probably want to write it into the spec up front.
Beta Was this translation helpful? Give feedback.
All reactions