mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.63k stars 1.63k forks source link

additional options to wx-config for wxwidgets dependency #13048

Open vid512 opened 7 months ago

vid512 commented 7 months ago

I am trying to convert my old project using wxWidgets to meson. I failed to replicate certain configurations, without the ability to specify additional options to wx-config. Note that I am very new to meson, so some of these problems may have an obvious solution, or maybe be contrary to its philosophical limitations.

  1. Select which toolkit to use (eg. pass --toolkit=gtk2 to wx-config). Seems mentioned here as useful, but unsupported yet: https://github.com/mesonbuild/meson/issues/6811 . Without some way around this, I can't really use meson for the project.

  2. Use debug build of wxwidgets in debug build of my project. Eg. pass --debug=yes to wx-config with --buildtype=debug only. Using debug build of wxwidgets in debug build of an application is desirable, as it can help catch some errors.

  3. Ability to use shared library build of wxwidgets in debug builds (for faster compile / link), but static library in release build (to prevent external dependencies). Eg. ability to pass --static=no to wx-config when building debug build of project.

Is this possible?

dcbaker commented 7 months ago
  1. is possible by passing the static : <bool> option to dependency(), and I've checked that is wired up. So you should be able to do something like: dependency('wxwidgets', static : not get_option('debug')). Do not that if you plan to have your software shipped by Linux distros they will want to dynamically link wxwidgets)

  2. might be possible with a native file, like in the linked issue. doing something like wx-widgets = ['wx-widgets', '--debug=yes'] might work, though I haven't tested it.