meson: reconsider G_DISABLE_CAST_CHECKS handling
Currently G_DISABLE_CAST_CHECKS gets added only for release
buildtype, but (almost all) distributions pass --buildtype=plain
, thus since the meson port, they may have lost this optimization without even being aware of it.
While working on finally bringing 2.60 to Gentoo, I however noticed this while carefully comparing things, and will have to manually add -DG_DISABLE_CAST_CHECKS to CFLAGS to not regress from 2.58 in this aspect.
I believe there's some improvement opportunities here.
Perhaps do it with buildtype == 'plain' too? Or change from elif buildtype == 'release'
to else
in there? Or is it now considered fine to cast check in release distro builds?
Compared to autotools, there's no --enable-debug=no equivalent anymore either, to additionally pass -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
, but I don't particularly care about that personally.
GTK is apparently affected by this as well. gtk#2020 (comment 552880)