Meson build plugins / link with static lib

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Meson build plugins / link with static lib

Frederic Turmel
Hi, i'm trying to use external static library to my plugin using meson. I know this is not directly a gstreamer question but perhaps there is a simple answer

The external lib is in C  and configinc has all the lib path using include_directories function.

I tried the following command but the linker still complain. 
my_lib = static_library('XXXXX_capture')

my_dep = declare_dependency(link_with : my_lib, include_directories : configinc)

Is there an example in the repo? I search but all I could find in external dependency that gets build as subproject.

Thanks
FredT

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Meson build plugins / link with static lib

Nicolas Dufresne-5
Le jeudi 23 janvier 2020 à 16:07 -0800, Frederic Turmel a écrit :

> Hi, i'm trying to use external static library to my plugin using
> meson. I know this is not directly a gstreamer question but perhaps
> there is a simple answer
>
> The external lib is in C  and configinc has all the lib path
> using include_directories function.
>
> I tried the following command but the linker still complain.
> my_lib = static_library('XXXXX_capture')
>
> my_dep = declare_dependency(link_with : my_lib, include_directories :
> configinc)
>
> Is there an example in the repo? I search but all I could find in
> external dependency that gets build as subproject.

Prior to meson, we'd use autotools which would use libtools for static
linking. For each .a there would be .la file that describe the link
dependencies. With meson, libtool is no longer used, you need a
<mylib>.pc file (pkg-config) with a Libs.private section.

You can of course pass all the deps manually, but if you are looking
for examples of what parameter being pass, you'll have to look inside
these .pc files. Note that not all projects have Libs.private or a
proper implementation of it yet.

>
> Thanks
> FredT
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Meson build plugins / link with static lib

Frederic Turmel
Thanks. I actually figured it out. 

cmplr = meson.get_compiler('c')
then use x = cmplr.find_library( 'xyz', dirs: 'pathtofile')
library('plugin name',
dependencies: [x]
....)

On Thu, Jan 23, 2020 at 5:56 PM Nicolas Dufresne <[hidden email]> wrote:
Le jeudi 23 janvier 2020 à 16:07 -0800, Frederic Turmel a écrit :
> Hi, i'm trying to use external static library to my plugin using
> meson. I know this is not directly a gstreamer question but perhaps
> there is a simple answer
>
> The external lib is in C  and configinc has all the lib path
> using include_directories function.
>
> I tried the following command but the linker still complain.
> my_lib = static_library('XXXXX_capture')
>
> my_dep = declare_dependency(link_with : my_lib, include_directories :
> configinc)
>
> Is there an example in the repo? I search but all I could find in
> external dependency that gets build as subproject.

Prior to meson, we'd use autotools which would use libtools for static
linking. For each .a there would be .la file that describe the link
dependencies. With meson, libtool is no longer used, you need a
<mylib>.pc file (pkg-config) with a Libs.private section.

You can of course pass all the deps manually, but if you are looking
for examples of what parameter being pass, you'll have to look inside
these .pc files. Note that not all projects have Libs.private or a
proper implementation of it yet.

>
> Thanks
> FredT
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel