From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A74643BA7; Thu, 7 Mar 2024 11:47:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 554CC42D87; Thu, 7 Mar 2024 11:47:09 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BFAC3402C2 for ; Thu, 7 Mar 2024 11:47:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709808427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LeuTRtyZvFDIgieMpkdtgbHWCkvCucBxYAKqLUZPLKk=; b=hVMeVxNCBp4Fy2YalmivCNi3NRQfNK955Zatr+1Jo74d4DGXaqB7jYRPolSpytC7xUNyY0 28lDZWQsa7iR1a401gpSANig3B9k+0ajYciQCGdW8z8cMX+a8dAmuSQpb07MVq1QQmDXif gBxI4JGPnFTP9aHdE840NgMFkN0/DWk= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-OoJHcxVbOG-5Q8I9TBoFIQ-1; Thu, 07 Mar 2024 05:47:05 -0500 X-MC-Unique: OoJHcxVbOG-5Q8I9TBoFIQ-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2d2e4ea0f63so4350291fa.2 for ; Thu, 07 Mar 2024 02:47:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709808423; x=1710413223; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LeuTRtyZvFDIgieMpkdtgbHWCkvCucBxYAKqLUZPLKk=; b=RgyVW84i7lHS14qYFCYI9Y+BxZ28rAeX2iM8tED9v+TDOKIwvj6jQOdII1osfB6sPL j7zr0SKBm4FY26/9sxGJ3UBkl/VC1lF9fgrmEivyvbQ+8tmjFmnsQ4EOLeMIBQo6aGAW 8XRla3D6SAus/IszDcbsNmITotAubBGBKcqKSKk6p0mTT7omf+hT0vNFBgsfLY0mCDCv UrH4cpt50KSVctSI6Jgd13nSVTV5y1gukLYctFvCpqSSBWL1iM1TcG97h7kcaqCTRxtN Y/Ch/AVtxjUmWRpTg0Y8iiYVP+SmoOo2Lvwl82BsPGP5GQs4HEtQ3I813fSRe8ttAeDb rLVA== X-Forwarded-Encrypted: i=1; AJvYcCWwvQxC89aLD7U//M4un/pzhMv1CZdjvaaWKWsQHdY93aIeguBq7BgTsKznMr1r0FHEfvwgD+4CfOCj7pA= X-Gm-Message-State: AOJu0YyE6A08b2UyhVK648HS0PUxdDGIUoxlSjW4bh2070dsvERyMAAW 69dudzmSYWanutFFFQw6pSxVHq97ypH1zn4Bt40GOuJWNKgaondCyFplvtmNcYpZeKeRH5fHhnX N+DIXWdBsLE4Ae1x5uHD+cCz5kwaoH50oGaGQK7rRSb/iC6r1E+tqqlj/EZDZSokSgeDg3Yjvr2 CfGhmPA5ikcc2V1So= X-Received: by 2002:a2e:809a:0:b0:2d2:f148:29fc with SMTP id i26-20020a2e809a000000b002d2f14829fcmr1100954ljg.12.1709808423748; Thu, 07 Mar 2024 02:47:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ6eMomQ6SL11d2pa+S8T8wqKO62C5IzObdXKVoK9JmJi8pCDZxV6dKWJQlpURAwZF/8RcsuHRs9W5b7QQ1wM= X-Received: by 2002:a2e:809a:0:b0:2d2:f148:29fc with SMTP id i26-20020a2e809a000000b002d2f14829fcmr1100936ljg.12.1709808423411; Thu, 07 Mar 2024 02:47:03 -0800 (PST) MIME-Version: 1.0 References: <20240306221709.166722-1-paul.szczepanek@arm.com> <20240306221709.166722-2-paul.szczepanek@arm.com> In-Reply-To: <20240306221709.166722-2-paul.szczepanek@arm.com> From: David Marchand Date: Thu, 7 Mar 2024 11:46:51 +0100 Message-ID: Subject: Re: [PATCH v1 1/1] lib: allow libraries with no sources To: Paul Szczepanek Cc: thomas@monjalon.net, dev@dpdk.org, Dhruv Tripathi , Bruce Richardson X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Mar 6, 2024 at 11:17=E2=80=AFPM Paul Szczepanek wrote: > > Allow header only libraries. > > Signed-off-by: Paul Szczepanek > Reviewed-by: Dhruv Tripathi 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 +=3D include_directories(l) > dpdk_includes +=3D include_directories(l) > > + if sources.length() !=3D 0 > if developer_mode and is_windows and use_function_versioning > message('@0@: Function versioning is not supported by Window= s.'.format(name)) > endif > @@ -321,6 +322,11 @@ foreach l:libraries > > dpdk_libraries =3D [shared_lib] + dpdk_libraries > dpdk_static_libraries =3D [static_lib] + dpdk_static_libraries > + else # sources.length() =3D=3D 0 > + # if no C files, just set a dependency on header path > + shared_dep =3D 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 =3D declare_dependency(include_directories: includes) + shared_dep =3D declare_dependency(include_directories: includes, + dependencies: shared_deps) > + static_dep =3D shared_dep > + endif > > set_variable('shared_rte_' + name, shared_dep) > set_variable('static_rte_' + name, static_dep) --=20 David Marchand