linking executables, dependencies and link_with?

162 views
Skip to first unread message

Chris Hecker

unread,
Oct 19, 2022, 5:30:13 AM10/19/22
to meson...@googlegroups.com

So does link_with not automatically add dependencies if you're linking with a library you built elsewhere above in the meson.build?  I got into a situation with my testing where I deleted a source file and it didn't rebuild the library correctly, which didn't rebuild the executable correctly.  It was strange.  In the examples in the docs it seems like you shouldn't need both...I haven't tried to repro the issue, but I am confused how it happened.

Chris

Chris Hecker

unread,
Oct 19, 2022, 6:25:27 AM10/19/22
to meson...@googlegroups.com

Okay, I messed with these settings a bit and did some diffs of the generated build.ninja files, and it seems like this:

If you build a lib with include dirs and whatnot, you can put the include_directories and links_with in a declare_dependency object and just pass that as a dependency to the executable and it's exactly the same as if you'd separately passed the include_directories and links_with to the executable, so the declare_dependency object is just a way to wrap up the various params to another target so you don't have to have them all separate?

Chris
Reply all
Reply to author
Forward
0 new messages