[v2,10/10] raw/ifpga: use common base code build handling

Message ID 20250407152509.2203243-11-bruce.richardson@intel.com (mailing list archive)
State New
Delegated to: David Marchand
Headers
Series centralize base code handling for drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/github-robot: build success github build: passed
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Bruce Richardson April 7, 2025, 3:25 p.m. UTC
Use the base code build handling logic in the drivers/meson.build file,
rather than re-implementing it in the driver itself.

While making changes similar to that in other drivers, also move content
around dependencies from the base/meson.build file to the main
driver meson.build file, so that the base code file only contains the
list of base code files.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rosen Xu <rosen.xu@altera.com>
---
 drivers/raw/ifpga/base/meson.build | 21 ++-------------------
 drivers/raw/ifpga/meson.build      | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 22 deletions(-)
  

Patch

diff --git a/drivers/raw/ifpga/base/meson.build b/drivers/raw/ifpga/base/meson.build
index 2de8e7ea22..efebff94e9 100644
--- a/drivers/raw/ifpga/base/meson.build
+++ b/drivers/raw/ifpga/base/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-sources = [
+base_sources = files(
         'ifpga_api.c',
         'ifpga_enumerate.c',
         'ifpga_feature_dev.c',
@@ -23,21 +23,4 @@  sources = [
         'opae_i2c.c',
         'opae_at24_eeprom.c',
         'opae_eth_group.c',
-]
-
-rtdep = dependency('librt', required: false)
-if not rtdep.found()
-    rtdep = cc.find_library('rt', required: false)
-endif
-if not rtdep.found()
-    build = false
-    reason = 'missing dependency, "librt"'
-    subdir_done()
-endif
-
-ext_deps += rtdep
-
-base_lib = static_library('ifpga_rawdev_base', sources,
-    dependencies: static_rte_eal,
-    c_args: cflags)
-base_objs = base_lib.extract_all_objects(recursive: true)
+)
diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.build
index 444799cfb2..4295ec04bd 100644
--- a/drivers/raw/ifpga/meson.build
+++ b/drivers/raw/ifpga/meson.build
@@ -7,8 +7,19 @@  if not has_libfdt
     subdir_done()
 endif
 
+rtdep = dependency('librt', required: false)
+if not rtdep.found()
+    rtdep = cc.find_library('rt', required: false)
+endif
+if not rtdep.found()
+    build = false
+    reason = 'missing dependency, "librt"'
+    subdir_done()
+endif
+
+ext_deps += rtdep
+
 subdir('base')
-objs = [base_objs]
 
 deps += ['ethdev', 'rawdev', 'pci', 'bus_pci', 'kvargs',
     'bus_vdev', 'bus_ifpga', 'net', 'net_i40e', 'net_ipn3ke']
@@ -17,6 +28,4 @@  sources = files('ifpga_rawdev.c', 'rte_pmd_ifpga.c', 'afu_pmd_core.c',
     'afu_pmd_n3000.c', 'afu_pmd_he_lpbk.c', 'afu_pmd_he_mem.c',
     'afu_pmd_he_hssi.c')
 
-includes += include_directories('base')
-
 headers = files('rte_pmd_ifpga.h')