Skip to contentSkip to conversation

net/octeontx: meson build fix if octeontx drivers are disabled

PATCH In review [email protected] 2 participants 2 messages Feb 17, 2020 – Apr 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/octeontx: meson build fix if octeontx drivers are disabled

From: Amit Gupta <[email protected]>

Add a condition to check if octeontx drivers are disabled. octeontx drivers are built only if dependent drivers i.e. ethdev, mempool and common/octeontx are enabled.

BugZilla ID # BUG 387

Change-Id Idf9578fc04345e690ac48b4836faff2e25170331
---
 drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
drivers/net/octeontx/base/meson.build +24 -8
index a06a2c8..50e7972 100644
@@ -9,17 +9,33 @@ sources = [
 
 depends = ['ethdev', 'mempool_octeontx']
 static_objs = []
-foreach d: depends
-	static_objs += [get_variable('static_rte_' + d)]
+
+disabled_drivers = get_option('disable_drivers').split(',')
+
+build = true
+foreach disable_path: disabled_drivers
+        if (('net/octeontx' == disable_path) or
+	   ('event/octeontx' == disable_path) or
+	   ('common/octeontx' == disable_path) or
+	   ('mempool/octeontx' == disable_path))
+                build = false
+        endif
 endforeach
 
 c_args = cflags
 if allow_experimental_apis
-	c_args += '-DALLOW_EXPERIMENTAL_API'
+        c_args += '-DALLOW_EXPERIMENTAL_API'
 endif
-base_lib = static_library('octeontx_base', sources,
-	c_args: c_args,
-	dependencies: static_objs,
-)
 
-base_objs = base_lib.extract_all_objects()
+if build
+        foreach d: depends
+                static_objs += [get_variable('static_rte_' + d)]
+        endforeach
+
+        base_lib = static_library('octeontx_base', sources,
+                c_args: c_args,
+                dependencies: static_objs,
+        )
+
+        base_objs = base_lib.extract_all_objects()
+endif
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Mon, Feb 17, 2020 at 01:10:29PM +0530, [email protected] wrote:

From: Amit Gupta <[email protected]>

Add a condition to check if octeontx drivers are disabled. octeontx drivers are built only if dependent drivers i.e. ethdev, mempool and common/octeontx are enabled.

BugZilla ID # BUG 387

Change-Id Idf9578fc04345e690ac48b4836faff2e25170331
Quoted 53 lines
---
 drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
drivers/net/octeontx/base/meson.build +24 -8
index a06a2c8..50e7972 100644
@@ -9,17 +9,33 @@ sources = [
 
 depends = ['ethdev', 'mempool_octeontx']
 static_objs = []
-foreach d: depends
-	static_objs += [get_variable('static_rte_' + d)]
+
+disabled_drivers = get_option('disable_drivers').split(',')
+
+build = true
+foreach disable_path: disabled_drivers
+        if (('net/octeontx' == disable_path) or
+	   ('event/octeontx' == disable_path) or
+	   ('common/octeontx' == disable_path) or
+	   ('mempool/octeontx' == disable_path))
+                build = false
+        endif
 endforeach
 
 c_args = cflags
 if allow_experimental_apis
-	c_args += '-DALLOW_EXPERIMENTAL_API'
+        c_args += '-DALLOW_EXPERIMENTAL_API'
 endif
-base_lib = static_library('octeontx_base', sources,
-	c_args: c_args,
-	dependencies: static_objs,
-)
 
-base_objs = base_lib.extract_all_objects()
+if build
+        foreach d: depends
+                static_objs += [get_variable('static_rte_' + d)]
+        endforeach
+
+        base_lib = static_library('octeontx_base', sources,
+                c_args: c_args,
+                dependencies: static_objs,
+        )
+
+        base_objs = base_lib.extract_all_objects()
+endif
Signature · 1 line
1.8.3.1