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 09F0E43E52; Fri, 12 Apr 2024 15:00:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC482410E8; Fri, 12 Apr 2024 15:00:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by mails.dpdk.org (Postfix) with ESMTP id 444F2400D6 for ; Fri, 12 Apr 2024 15:00:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712926855; x=1744462855; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=cKzXTviJ2sBjQCvWhZqfhBlUfnFIMl/rP0R5MEaLqq8=; b=FInkIfcxXBTEWWqb9XnH85QEtfpeYERHCBh8ZVYQIoOJ4JKBAdAOEyk2 VV6e8I1JyuCm6FC+EqHYQ5Fodtvas3vxT8V1tb3muAN+bCVPfEOMbnPsW pY+TwjNgh7+zHrkPz/wkICDO7u9xLi4Dj2fkZ/211P1xcgl5iRmsm1PH0 QKIhf84Qn4kwHoaHmRvLl9hjOq5EcCCnNHThSooUWVVTeX4JY5wqWCMq8 JUYbEIKdVdIlaF0SJt5h/CSWuJv/zJuxJDK8Aty5L5GnHWWmery9gA/iW e6TpSr3pUsJ9U0ZqfStEJkTAN0JYVYVEB6OdZurIfsRQtatVrWkgTE/+G A==; X-CSE-ConnectionGUID: X0RjtQHyQze6Zk5q+s6yLw== X-CSE-MsgGUID: eWGuKjeVS+q3nWRvbrqpYQ== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="8296788" X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="8296788" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 06:00:54 -0700 X-CSE-ConnectionGUID: 6LS4B6vcRe2OKf5qvyqh2Q== X-CSE-MsgGUID: sLe1e4qpSGm6TSGbcUHVqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="25777433" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Apr 2024 06:00:53 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 06:00:52 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 06:00:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 06:00:51 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 06:00:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/UpC8IDpAKDvKIpemSICGRq7/7Mq9Q46XjKRWVoGxTJEoB+dh9CQ0FRKMWYS9ciZwUO67whrSGhVLJUBvprCOiQ1/orzRqJUmyo8tOReS8epiGA9ziszzk+p+dH2iGCme921LAtYJeGgHJs4J6n2GgR1rMXToAe1CMzqWPtRMudPjjs7b2unjPk1X7hPMe5euXkUTjRyUrf7z5EYPGAKuvOKtIq4J81axR9pYNAXw8ROyAvpbcqA2FF4DPbaLYuVVZ1SstIkAmfbTk2jeqOJR6n07ZUDITIANq9dbHx7G+93VlEaehLsoUWs0gQPKVb4zAmZkLATvhE22yyjo+9Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E5H8rGkAb7MqdxtVio9aJUmVjVNXNva3rgZq9ZJJJf4=; b=Hiooa/pu6L9Xw5c4P34bubfw/K5BhLSvw7JcWpOBw4lu2gyKhx1d/8T02EwE8k2fA1el653R0rXJXStKPBv5Q7sCHQf9HR99zT6jRBcNyHUKXiI8x3CXucxOOt4ScYKqmpbd3OLFGMiMjYiS3mA8aPW0mgvl6xc0bEdIoMmYAnBU3WEwbqmwni3wJIPBBmmqwgrri0ZX2d0YsiBvK9g+HyvmkCRHEni7EoAIojMb1Np9eo643D3GTV4xT4joET5w10sJJkF6PlammFS3kW6x2xmfXhYAtiPh2h5TJiHQzHjhyN5VmG0uO8ZqvWaA6lwF7rmj25I295o+qVGW2gdImA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA1PR11MB6396.namprd11.prod.outlook.com (2603:10b6:208:3ab::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26; Fri, 12 Apr 2024 13:00:49 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7452.019; Fri, 12 Apr 2024 13:00:48 +0000 Date: Fri, 12 Apr 2024 14:00:43 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , Harman Kalra Subject: Re: [PATCH v2 1/2] build: build only one library type on Windows Message-ID: References: <1710445477-23848-1-git-send-email-roretzla@linux.microsoft.com> <1710484222-17310-1-git-send-email-roretzla@linux.microsoft.com> <1710484222-17310-2-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1710484222-17310-2-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: DB8PR06CA0056.eurprd06.prod.outlook.com (2603:10a6:10:120::30) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA1PR11MB6396:EE_ X-MS-Office365-Filtering-Correlation-Id: e2e7ee4c-ee28-4cab-6c77-08dc5af09301 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NyuH05kZEZGmTlqO5Sig1wtbqMvGgagxO88NVLJs9l3WpHjRPjrlGfwQxXS8qmsHfPyn8PkT3Q15XYls/7xzK2enDtgflp7NTvmYlShmD9dUQ9TYwGQYALlTqbVbwh+QmM7XguOmohIgaPnm0gV/Z4h3/OWnmYZ1hgiKikORKgeDaAgpf7TOQid43p+oZeCYHBmVnaxdFVCANRSx8Qnw/VXqWTA402Usra3vP4JX/G4GC72hfgd/OBZ+qx5QxHKdj/8SQ+0sU0yyL0EWx54aYWT5oQO1eZPK8pdjjca9nfHrPwxHrZUfraseLwdSXw1mF2S7TkF8yCTgs/zA311pu7VSDkeIGsZxiZGNRyvqALVgpyeMj/k8yVCmpb8FpNI1lVAmXhSD1UBEj22L5I6Fp4gcnrXIjpJZ51DTNCcM9ndz85k+yvTjv9SXvlW6ux2a1txO9O/OuJo0jhByasu4/HDiFYcYNiWYwF73s6Y4WPvYTttWE55BrEhxzPNuMbqrbCaxvwUeG31vc9ewva6mrOHGxBshDqv8sWaZxARIT8du9pYS1W3+Rdmt4iav30QuQItwcyJBYrYhdy+vLVtCv2IH9cHmbnAvB4K1mAzSK/ccFHo9Q16+fIVn2wkcN3unfutPvaLh83lj1x7/YMFJu8KKemR1W8OnebTMPHqmmnU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YKs6oFIE87cmGbJdsj5af9ob+GGruqldPdmLjiNv3NJZd1tyB7mjz5xFBrfc?= =?us-ascii?Q?e95N9lTdCnN2KS9+Xs+LSvWA7hMrhCmD2UTPBChuWmP8USSp3oRwacoVPsHE?= =?us-ascii?Q?xGYUKHViA3jC6ZdRro4maNPCzhLyLSsxKq94djLC8qfrzd+keqQkPsYtDaag?= =?us-ascii?Q?QmMUgGCo/yvcSxBKf+h9fKV8SXyJJ96x8LTF6DFMVMxgXYcIr7IRWiSq0A0P?= =?us-ascii?Q?fQdGhPAb2dsIZe/bMMTegCMJeXto6a2cGAtwlEDNdODvk9yRDQSKGH5Qh/A0?= =?us-ascii?Q?5JFTRYYUTqRZevxFPYnpuMzjMLgcnWmByPrx/PgzDLPVsEPWe2iYDT+MJGFd?= =?us-ascii?Q?oLUMBIzbIK1q1Hjo9nsbqJjzh5sDHTnaSD81j/C5iwlqFf+ckyxg5yb66ntP?= =?us-ascii?Q?7tlZuDd1V8GT5HZLaxIl8VeK7Zoq+cqclb25WxLKhKr229PxwnWyQG+05Ro7?= =?us-ascii?Q?fxFPRwj0VsowzhTXmvVHoW+r7nOXhLHjCJ3fk2I7sMSC0UvP2mbxu6YZVzog?= =?us-ascii?Q?Eb2pDovQL7LeCfkOAmlEn9fz0Ea4c+QhntIWbbwsVpGCJJDCjp5ue51fZtc2?= =?us-ascii?Q?KWEqtePkdKqqHhMIAv6GEjW/6bIXFM+k3VSrPgiTgTtuR+33UlMfLEo8yKBi?= =?us-ascii?Q?QDzKtTgkEUXxOTQ5Dl6nUZmz4m3C1UwduPcZxLzeQ4naCyMBxFNh71ikYHIc?= =?us-ascii?Q?2n20u1ztEPj8GG0kVAAvc8U7SDlujAUf89gqL/B7iStcyFGpGHgRnSGBebIJ?= =?us-ascii?Q?GDHPxLT0E9UMzDKF45w07S+rEwMxLybLXm4ugOf78syKQxfFn7cTy2bmrAxC?= =?us-ascii?Q?bqPx5TJmPVF5sWV3bw01u4L4sb1AMMX0A0QYilinKC21tXbRP4IkRRfrEnEK?= =?us-ascii?Q?X7QfE+pUZdOTdL+QXiqTdrVpgJNXETOiXqI3kw2p0bn4Azl4Zcv6wgALpWZ/?= =?us-ascii?Q?2kjILkCPu8f2VCw0hHN7WP9t/vIUmDhGCNy9pTxxbX6kvp9h/JWtirURac5Y?= =?us-ascii?Q?OTCNTktwpme+aQ+0VD5cweXBEplppBKrQ8eRqPRIYiYS74DnkzKMJTrmlna8?= =?us-ascii?Q?hG5ZoIeevJ1uhGSEN+e4UFZW4vqnH6h1bUxSVtpDLekjqqzvtXQRARRDJMb0?= =?us-ascii?Q?MV/dSS9Bh0V/dgLXwbRusBvp3AMA+ipD4K7xaJRJx+mrjx2eSEDV1Qaii0oQ?= =?us-ascii?Q?ZJ7yNKPAioVWb3vkJnc8UzKzlRzIONeylxHZAE0PT0LIu9+gDP2z8MHRS/F6?= =?us-ascii?Q?JpnHihjS7eMKkN3FOQcndH6rinGOOlvVYtKQslhr4uNY2udjMcSPzExq87bL?= =?us-ascii?Q?cwhmU8f3cF/0lums7mCm0QwzTzo9052JKMxrkreRLAyIIW5Gyyb+xfzbGkCr?= =?us-ascii?Q?OzBvUglgiPF3vLJ9PfcjOSyC/eBMMlLuzwLkNrLG2LszBd+Dhy77jT0iydr4?= =?us-ascii?Q?+UfTHPs9z2j9fcHJe+ryaergkP3HU+HqE9BRrHIGdZMubhGP/NLdACAhxnE3?= =?us-ascii?Q?Eg66upUpfs4VCHwQ4oYdoqwlGnMYCrC4E1gfRWJhiY0gWbQlMoIDoK8vGFD4?= =?us-ascii?Q?5MxHo7YnpCDnHRnrDvaWcB0fyGaTpNV4noiKOL5oln3PI0BEccAJ2elUtKTS?= =?us-ascii?Q?gQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: e2e7ee4c-ee28-4cab-6c77-08dc5af09301 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 13:00:48.7244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +xri5OqXo7wr9L0hSOHd0Vr+/XF6sJnXd7Qb67WyySh2TN3wTaau4HSLqVPok+d8vy+1HNDzUDhVgczy0RlrKLD33NIxybYwcAIhlXpw5kY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6396 X-OriginatorOrg: intel.com 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 Thu, Mar 14, 2024 at 11:30:21PM -0700, Tyler Retzlaff wrote: > MSVC is the only compiler that can produce usable shared libraries for > DPDK on Windows because of the use of exported TLS variables. > > Disable building of shared libraries with LLVM and MinGW so that > remaining __declspec macros needed for the functional libraries built by > MSVC can be used without triggering errors in LLVM and MinGW builds. > > For Windows only install the default_library type to avoid confusion. > Windows builds cannot build both shared and static in a single pass so > install only the functional variant. > > Signed-off-by: Tyler Retzlaff Comments inline below. /Bruce > --- > app/meson.build | 6 +++ > config/meson.build | 27 ++++++++++++ > drivers/meson.build | 72 +++++++++++++++---------------- > drivers/net/octeontx/base/meson.build | 2 +- > examples/meson.build | 6 +++ > lib/meson.build | 79 +++++++++++++++-------------------- > 6 files changed, 108 insertions(+), 84 deletions(-) > > diff --git a/app/meson.build b/app/meson.build > index 21b6da2..f4ed0f1 100644 > --- a/app/meson.build > +++ b/app/meson.build > @@ -46,6 +46,8 @@ default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] > default_ldflags = [] > if get_option('default_library') == 'static' and not is_windows > default_ldflags += ['-Wl,--export-dynamic'] > +elif get_option('default_library') == 'shared' and is_ms_compiler > + default_ldflags += ['/experimental:tlsDllInterface'] > endif > Is this necessary, given that you add this flag as a project-wide argument below in config/meson.build? > foreach app:apps > @@ -104,6 +106,10 @@ foreach app:apps > link_libs = dpdk_static_libraries + dpdk_drivers > endif > > + if is_windows and is_shared_enabled > + cflags += '-DRTE_BUILD_SHARED_LIB' > + endif > + > exec = executable('dpdk-' + name, > sources, > c_args: cflags, > diff --git a/config/meson.build b/config/meson.build > index 8c8b019..dd7971e 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -53,6 +53,9 @@ if is_ms_compiler > > # enable statement expressions extension > add_project_arguments('/experimental:statementExpressions', language: 'c') > + > + # enable export of thread_local variables > + add_project_arguments('/experimental:tlsDllInterface', language: 'c') > endif > > # set the major version, which might be used by drivers and libraries > @@ -516,4 +519,28 @@ if get_option('default_library') == 'both' > NOTE: DPDK always builds both shared and static libraries. Please set > "default_library" to either "static" or "shared" to select default linkage > for apps and any examples.''') > +elif get_option('default_library') == 'shared' and is_windows and not is_ms_compiler > + error( ''' > + Unsupported value "shared" for "default_library" option. > + > + NOTE: DPDK Windows shared is only supported when building with MSVC. Please set > + "default_library" to either "static" or use MSVC.''') > +endif > + > +if is_windows > + if is_ms_compiler and get_option('default_library') == 'shared' > + is_shared_enabled=true > + else > + is_shared_enabled=false > + endif > +else > + is_shared_enabled=true > +endif > + This can be shortened to: is_shared_enabled=true if is_windows and (not is_ms_compiler or not get_option(...) == 'shared') is_shared_enabled=false endif > +if is_windows > + install_static = get_option('default_library') == 'static' > + install_shared = get_option('default_library') == 'shared' > +else > + install_static=true > + install_shared=true > endif Might be better merged with the block above: is_shared_enabled = true install_static = true install_shared = true if is_windows install_static = get_option('default_library') == 'static' install_shared = get_option('default_library') == 'shared' if not is_ms_compiler or not install_shared is_shared_enabled = false endif endif > diff --git a/drivers/meson.build b/drivers/meson.build > index 66931d4..c8b2d13 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -80,7 +80,7 @@ foreach subpath:subdirs > subdir(class) > skip_class = false > foreach d:std_deps > - if not is_variable('shared_rte_' + d) > + if not is_variable('static_rte_' + d) > skip_class = true > reason = 'missing internal dependency, "@0@"'.format(d) > if dpdk_libs_deprecated.contains(d) > @@ -173,7 +173,7 @@ foreach subpath:subdirs > if not build > break > endif > - if not is_variable('shared_rte_' + d) > + if not is_variable('static_rte_' + d) > build = false > reason = 'missing internal dependency, "@0@"'.format(d) > if dpdk_libs_deprecated.contains(d) > @@ -188,7 +188,9 @@ foreach subpath:subdirs > +'\tPlease enable missing dependency "@0@"'.format(d)) > endif > else > - shared_deps += [get_variable('shared_rte_' + d)] > + if is_shared_enabled > + shared_deps += [get_variable('shared_rte_' + d)] > + endif > static_deps += [get_variable('static_rte_' + d)] > endif > endforeach > @@ -208,6 +210,9 @@ foreach subpath:subdirs > enabled_drivers += name > lib_name = '_'.join(['rte', class, name]) > cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name]) > + if is_windows and is_shared_enabled > + cflags += '-DRTE_BUILD_SHARED_LIB' > + endif Rather than setting this in cflags in the drivers or lib meson.build files, can we set this once as a project-level cflag and be done with it? > if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0') > cflags += '-DRTE_ANNOTATE_LOCKS' > cflags += '-Wthread-safety' > @@ -247,7 +252,7 @@ foreach subpath:subdirs > include_directories: includes, > dependencies: static_deps, > c_args: cflags, > - install: true) > + install: install_static) > > # now build the shared driver > version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path) > @@ -271,55 +276,46 @@ foreach subpath:subdirs > endif > endif > > - if is_windows > - if is_ms_linker > + if is_shared_enabled > + if is_ms_compiler > def_file = custom_target(lib_name + '_def', > command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > input: version_map, > output: '@0@_exports.def'.format(lib_name)) > lk_deps += [def_file] > - > - lk_args = ['-Wl,/def:' + def_file.full_path()] > - if meson.version().version_compare('<0.54.0') > - lk_args += ['-Wl,/implib:drivers\\lib' + lib_name + '.dll.a'] > - endif > + lk_args = ['/experimental:tlsDllInterface', '/def:' + def_file.full_path()] Again, the /experimental flag shouldn't be necessary, since it's set as project option in config/meson.build. > else > - mingw_map = custom_target(lib_name + '_mingw', > - command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > - input: version_map, > - output: '@0@_mingw.map'.format(lib_name)) > - lk_deps += [mingw_map] > - > - lk_args = ['-Wl,--version-script=' + mingw_map.full_path()] > + lk_args = ['-Wl,--version-script=' + version_map] > endif > - else > - lk_args = ['-Wl,--version-script=' + version_map] > endif > > - shared_lib = shared_library(lib_name, sources, > - objects: objs, > - include_directories: includes, > - dependencies: shared_deps, > - c_args: cflags, > - link_args: lk_args, > - link_depends: lk_deps, > - version: abi_version, > - soversion: so_version, > - install: true, > - install_dir: driver_install_path) > - > - # create a dependency object and add it to the global dictionary so > - # testpmd or other built-in apps can find it if necessary > - shared_dep = declare_dependency(link_with: shared_lib, > - include_directories: includes, > - dependencies: shared_deps) > + if is_shared_enabled > + shared_lib = shared_library(lib_name, sources, > + objects: objs, > + include_directories: includes, > + dependencies: shared_deps, > + c_args: cflags, > + link_args: lk_args, > + link_depends: lk_deps, > + version: abi_version, > + soversion: so_version, > + install: install_shared, > + install_dir: driver_install_path) > + > + # create a dependency object and add it to the global dictionary so > + # testpmd or other built-in apps can find it if necessary > + shared_dep = declare_dependency(link_with: shared_lib, > + include_directories: includes, > + dependencies: shared_deps) > + > + set_variable('shared_@0@'.format(lib_name), shared_dep) Just a thought - could you avoid some of the changes throughout this set, if you add an else-leg to the "is_shared_enabled" check, where, if shared is not enabled, you assign shared_dep to be an empty string, or an empty object or something. That would mean that you wouldn't need to move the set_variable line as here, you also wouldn't need to put conditionals around all the Just a thought - could you avoid some of the changes throughout this set, if you add an else-leg to the "is_shared_enabled" check, where, if shared is not enabled, you assign shared_dep to be an empty string, or an empty object or something. That would mean that you wouldn't need to move the set_variable line as here, you also wouldn't need to put conditionals around all the 'shared_deps +=' lines when processing deps for a component, and lastly, you may not even need to change all the searches for shared_rte_ to static_rte, since the variables would exist for shared - they'd just be empty! > + endif > static_dep = declare_dependency( > include_directories: includes, > dependencies: static_deps) > > dpdk_drivers += static_lib