Open jpnurmi opened 4 years ago
What's the current status on this? It would be very useful for cross-platform generation.
How would you envision that this would work? Would this have to use a C package manager? Or is there some predictable transformation from an input string such as "gtk+-3.0"
to compiler options?
final res = await Process.run('pkg-config', ['--cflags', 'gtk+-3.0']);
print(res.stdout); // "-pthread -I/usr/include/gtk-3.0 ..."
Ah cool! (I was interpreting pkg-config as the Dart package config rather than a C tool. Which had me confused there.)
It should be relatively easy to integrate this.
pkg-config
is available on path, otherwise error if used in configAs I understand this doesn't work for Windows, correct?
Feel free to contribute a PR. 🙂
@mannprerak2 any ideas or concerns?
I guess it's fine by me.
Also, can one not simply write a script which takes pkg-config output and supplies compiler opts to dart run ffigen --compiler-opts="......"
P.S I haven't worked with pkg-config.
It would be nice to be able to simply specify the desired package(s) instead of fiddling with
compiler-opts
. For example:ffigen can use pkg-config on systems where available, and populate compuler-opts by itself: