-
Notifications
You must be signed in to change notification settings - Fork 363
Fix meson configuration files #1475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1475 +/- ##
=======================================
Coverage 64.83% 64.83%
=======================================
Files 51 51
Lines 9010 9010
Branches 1055 1055
=======================================
Hits 5842 5842
Misses 3168 3168
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
docs/meson.build
Outdated
pod2man, | ||
'--name=dunst', | ||
'--center=Dunst Reference', | ||
'--center="Dunst Reference"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since meson uses arrays and safely quotes them, this will result in invoking pod2man with:
pod2man --name="dunst" --center="\"Dunst Reference\"" --section="1" ....
which may or may not be what you want...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops didn't know that the arguments were actually parsed. thanks for the tip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eli do you know perhaps of a way to include the cflags used by meson in the executable itself?
dunst -version did display the compilation flags when make is used but I can't find a way to replicate that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds similar to https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonbuild_options
If the cflags are passed via
meson setup builddir/ -Dc_args="$CFLAGS"
Then those should be getting recorded in meson.build_options()
.
You could also directly use:
cflags_str = ' '.join(get_option('c_args'))
With zero guarantees about their quotedness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds similar to https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonbuild_options
If the cflags are passed via
meson setup builddir/ -Dc_args="$CFLAGS"
Then those should be getting recorded in
meson.build_options()
.You could also directly use:
cflags_str = ' '.join(get_option('c_args'))With zero guarantees about their quotedness.
it seems like this could work only for args passed directly by the user. is there no way to get all the arguments used by the compiler actually? like all defines and includes and whatnots included in the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the makefile we do it here:
Line 82 in 669c586
-D_CCDATE="${BUILD_DATE}" -D_CFLAGS="$(filter-out $(filter -I%,${INCS}) -fdebug-prefix-map% -fmacro-prefix-map% -ffile-prefix-map%,${CFLAGS})" -D_LDFLAGS="$(filter-out -fdebug-prefix-map% -fmacro-prefix-map% -ffile-prefix-map%,${LDFLAGS})" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-D_CFLAGS="-g -std=gnu11 -pedantic -Wall -Wno-overlength-strings -Os -pthread -MMD -MP"
-D_LDFLAGS="-lm -lrt -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgio-2.0 -lharfbuzz -lgobject-2.0 -lglib-2.0 -lwayland-cursor -lwayland-client -lXinerama -lXrandr -lXss -lXext -lX11"
Do you really care about -MMD -MP? :o
LDFLAGS of the form -l*
are readable via readelf -d, I think this is the first time I've seen someone want to see them in --help.
like all defines and includes and whatnots included in the project?
You do explicitly filter out all includes, as well as any whatnots of the form -f*-prefix-map
.
Anyway I'm not averse to adding a way to do this in meson but currently it doesn't exist. In particular, any flags that are details of how meson lays out the build -- such as passing -I../src
-- currently cannot be determined, even though external user settings such as CFLAGS can be with some minor work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will admit that this feature was added more for the coolness factor. I wanted it to be like gcc/vim.
But if meson can't do it I'll just remove it at some point as the Makefile is phased out :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vim does show the individual CFLAGS / LDFLAGS, though I'm not exactly sure why I'd care. As a vim user, I've never looked at that information once.
GCC shows the configure options, so, equivalent to meson.build_options()
, and that is something I've definitely looked at before and found quite helpful to see which features were enabled at configure time.
fix #1462