DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] build: make gpudev optional
@ 2021-11-17 20:33 eagostini
  2021-11-17 12:36 ` Thomas Monjalon
  2021-11-17 21:39 ` [PATCH v2] " eagostini
  0 siblings, 2 replies; 6+ messages in thread
From: eagostini @ 2021-11-17 20:33 UTC (permalink / raw)
  To: dev; +Cc: Elena Agostini

From: Elena Agostini <eagostini@nvidia.com>

This library can be made optional.
drivers/gpu and app/test-gpudev depend on this library,
so there is a check for dependencies.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
 app/test-gpudev/meson.build      | 11 +++++++++--
 doc/guides/prog_guide/gpudev.rst |  1 +
 drivers/gpu/meson.build          |  9 ++++++++-
 lib/meson.build                  |  1 +
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
index 17bdef3646..7340fe29d6 100644
--- a/app/test-gpudev/meson.build
+++ b/app/test-gpudev/meson.build
@@ -1,5 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
-sources = files('main.c')
-deps = ['gpudev', 'ethdev']
+if dpdk_conf.has('RTE_LIB_GPUDEV')
+    sources = files('main.c')
+    deps = ['gpudev', 'ethdev']
+else
+    build = false
+    reason = 'gpudev library is disabled'
+    subdir_done()
+endif
+
diff --git a/doc/guides/prog_guide/gpudev.rst b/doc/guides/prog_guide/gpudev.rst
index e464109d35..8970c43865 100644
--- a/doc/guides/prog_guide/gpudev.rst
+++ b/doc/guides/prog_guide/gpudev.rst
@@ -23,6 +23,7 @@ Out of scope of this library is to provide a wrapper for GPU specific libraries
 on the device or create GPU specific objects
 (e.g. CUDA Driver context or CUDA Streams in case of NVIDIA GPUs).
 
+This library is set as optional and can be disabled with ``-Ddisable_libs=gpudev``.
 
 Features
 --------
diff --git a/drivers/gpu/meson.build b/drivers/gpu/meson.build
index 601bedcd61..f04594e712 100644
--- a/drivers/gpu/meson.build
+++ b/drivers/gpu/meson.build
@@ -1,4 +1,11 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
-drivers = [ 'cuda' ]
+if dpdk_conf.has('RTE_LIB_GPUDEV')
+    drivers = [ 'cuda' ]
+else
+    build = false
+    reason = 'gpudev library is disabled'
+    subdir_done()
+endif
+
diff --git a/lib/meson.build b/lib/meson.build
index dad9fce14d..d6e7cac178 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -76,6 +76,7 @@ optional_libs = [
         'pdump',
         'power',
         'vhost',
+        'gpudev',
 ]
 
 disabled_libs = []
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-17 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 20:33 [PATCH v1] build: make gpudev optional eagostini
2021-11-17 12:36 ` Thomas Monjalon
2021-11-17 12:56   ` Thomas Monjalon
2021-11-17 21:39 ` [PATCH v2] " eagostini
2021-11-17 14:10   ` Bruce Richardson
2021-11-17 17:23   ` Thomas Monjalon

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).