From: David Marchand <david.marchand@redhat.com>
To: Paul Szczepanek <paul.szczepanek@arm.com>
Cc: thomas@monjalon.net, dev@dpdk.org,
Dhruv Tripathi <Dhruv.Tripathi@arm.com>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [PATCH v1 1/1] lib: allow libraries with no sources
Date: Thu, 7 Mar 2024 11:46:51 +0100 [thread overview]
Message-ID: <CAJFAV8zA9s-JQ3O8T9G=+ZduuRX0RxQqmzVwXb0=i99tMeVs2A@mail.gmail.com> (raw)
In-Reply-To: <20240306221709.166722-2-paul.szczepanek@arm.com>
On Wed, Mar 6, 2024 at 11:17 PM Paul Szczepanek <paul.szczepanek@arm.com> wrote:
>
> Allow header only libraries.
>
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Reviewed-by: Dhruv Tripathi <Dhruv.Tripathi@arm.com>
Don't forget to Cc: Bruce, he is the build system maintainer.
>
> ---
> lib/meson.build | 176 +++++++++++++++++++++++++-----------------------
> 1 file changed, 91 insertions(+), 85 deletions(-)
Copy/pasting git show -w, it is easier to review:
> diff --git a/lib/meson.build b/lib/meson.build
> index 179a272932..293d65385d 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -222,6 +222,7 @@ foreach l:libraries
> includes += include_directories(l)
> dpdk_includes += include_directories(l)
>
> + if sources.length() != 0
> if developer_mode and is_windows and use_function_versioning
> message('@0@: Function versioning is not supported by Windows.'.format(name))
> endif
> @@ -321,6 +322,11 @@ foreach l:libraries
>
> dpdk_libraries = [shared_lib] + dpdk_libraries
> dpdk_static_libraries = [static_lib] + dpdk_static_libraries
> + else # sources.length() == 0
> + # if no C files, just set a dependency on header path
> + shared_dep = declare_dependency(include_directories: includes)
In the hypothetical case that such a header only library would depend
on some external library, I suspect we would need to pass external
dependencies here.
Like:
- shared_dep = declare_dependency(include_directories: includes)
+ shared_dep = declare_dependency(include_directories: includes,
+ dependencies: shared_deps)
> + static_dep = shared_dep
> + endif
>
> set_variable('shared_rte_' + name, shared_dep)
> set_variable('static_rte_' + name, static_dep)
--
David Marchand
next prev parent reply other threads:[~2024-03-07 10:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 22:17 [PATCH v1 0/1] " Paul Szczepanek
2024-03-06 22:17 ` [PATCH v1 1/1] lib: " Paul Szczepanek
2024-03-07 10:46 ` David Marchand [this message]
2024-03-07 11:42 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJFAV8zA9s-JQ3O8T9G=+ZduuRX0RxQqmzVwXb0=i99tMeVs2A@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=Dhruv.Tripathi@arm.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=paul.szczepanek@arm.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).