What's the difference between a library and a dependency in meson build

51 Views Asked by At

In meson, I can set C++ dependencies in two ways:

With dependency:

lib_example = library('example', sources : [...])
dep_example = declare_dependency(dependencies: [], link_with : [lib_example])
executable('exec', 'main.cc', dependencies: [dep_example])

Or with just library:

lib_example = library('example', sources : [...])
executable('exec', 'main.cc', link_with: [lib_example])

What's the difference between these two concepts?

0

There are 0 best solutions below