[v2] build: make gpudev optional

Message ID 20211117213901.26021-1-eagostini@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] build: make gpudev optional |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-testing warning apply patch failure

Commit Message

Elena Agostini Nov. 17, 2021, 9:39 p.m. UTC
  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      | 1 +
 doc/guides/prog_guide/gpudev.rst | 1 +
 drivers/gpu/meson.build          | 1 +
 lib/meson.build                  | 1 +
 4 files changed, 4 insertions(+)
  

Comments

Bruce Richardson Nov. 17, 2021, 2:10 p.m. UTC | #1
On Wed, Nov 17, 2021 at 09:39:01PM +0000, eagostini@nvidia.com wrote:
> 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      | 1 +
>  doc/guides/prog_guide/gpudev.rst | 1 +
>  drivers/gpu/meson.build          | 1 +
>  lib/meson.build                  | 1 +
>  4 files changed, 4 insertions(+)
> 
> diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
> index 17bdef3646..02286d3a6a 100644
> --- a/app/test-gpudev/meson.build
> +++ b/app/test-gpudev/meson.build
> @@ -3,3 +3,4 @@
>  
>  sources = files('main.c')
>  deps = ['gpudev', 'ethdev']
> +

This file and "drivers/gpu/meson.build" file can be removed from the patch,
since adding a blank line is unnecessary and is not related to the actual
patch changes. When preparing a patch, I'd suggest always double checking
that all changes introduced in the patch are intentional, and relevant to
the patch itself. If these whitespace fixups are intentional needed,
they should be sent as a separate patch just to make reviewing easier and
ensure each patch has only one logical change in it.

Thanks,
/Bruce
  
Thomas Monjalon Nov. 17, 2021, 5:23 p.m. UTC | #2
17/11/2021 22:39, eagostini@nvidia.com:
> 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.

Changed to
so they are automatically disabled if the lib is disabled.

> Signed-off-by: Elena Agostini <eagostini@nvidia.com>

Applied with blank lines fixed.
  

Patch

diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
index 17bdef3646..02286d3a6a 100644
--- a/app/test-gpudev/meson.build
+++ b/app/test-gpudev/meson.build
@@ -3,3 +3,4 @@ 
 
 sources = files('main.c')
 deps = ['gpudev', 'ethdev']
+
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..1e68a7746d 100644
--- a/drivers/gpu/meson.build
+++ b/drivers/gpu/meson.build
@@ -2,3 +2,4 @@ 
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
 drivers = [ 'cuda' ]
+
diff --git a/lib/meson.build b/lib/meson.build
index dad9fce14d..018976df17 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -67,6 +67,7 @@  libraries = [
 
 optional_libs = [
         'bitratestats',
+        'gpudev',
         'gro',
         'gso',
         'kni',