[3/3] build: limit what is built when using MSVC compiler

Message ID 1674674707-3094-4-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series unblock the use of the MSVC compiler |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Tyler Retzlaff Jan. 25, 2023, 7:25 p.m. UTC
  Build only kvargs and telemetry when is_ms_compiler.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/meson.build |  7 +++++++
 meson.build     | 13 +++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)
  

Comments

Bruce Richardson Jan. 26, 2023, 11:10 a.m. UTC | #1
On Wed, Jan 25, 2023 at 11:25:07AM -0800, Tyler Retzlaff wrote:
> Build only kvargs and telemetry when is_ms_compiler.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>  lib/meson.build |  7 +++++++
>  meson.build     | 13 +++++++++----
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/meson.build b/lib/meson.build
> index 82e4666..8e99e21 100644
<snip>
> --- a/meson.build
> +++ b/meson.build
> @@ -76,11 +76,16 @@ subdir('config')
>  
>  # build libs and drivers
>  subdir('lib')
> -subdir('drivers')
>  
> -# build binaries and installable tools
> -subdir('usertools')
> -subdir('app')
> +if is_ms_compiler
> +    enabled_apps = []
> +else
> +    subdir('drivers')
> +
> +    # build binaries and installable tools
> +    subdir('usertools')
> +    subdir('app')
> +endif
>  

My own preference here would be to put the checks inside the
subdirectories, and try and keep the top-level meson.build file clean.
Would that work ok?

>  # build docs
>  subdir('doc')
> -- 
> 1.8.3.1
>
  
Tyler Retzlaff Jan. 26, 2023, 5:28 p.m. UTC | #2
On Thu, Jan 26, 2023 at 11:10:26AM +0000, Bruce Richardson wrote:
> On Wed, Jan 25, 2023 at 11:25:07AM -0800, Tyler Retzlaff wrote:
> > Build only kvargs and telemetry when is_ms_compiler.
> > 
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > ---
> >  lib/meson.build |  7 +++++++
> >  meson.build     | 13 +++++++++----
> >  2 files changed, 16 insertions(+), 4 deletions(-)
> > 
> > diff --git a/lib/meson.build b/lib/meson.build
> > index 82e4666..8e99e21 100644
> <snip>
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -76,11 +76,16 @@ subdir('config')
> >  
> >  # build libs and drivers
> >  subdir('lib')
> > -subdir('drivers')
> >  
> > -# build binaries and installable tools
> > -subdir('usertools')
> > -subdir('app')
> > +if is_ms_compiler
> > +    enabled_apps = []
> > +else
> > +    subdir('drivers')
> > +
> > +    # build binaries and installable tools
> > +    subdir('usertools')
> > +    subdir('app')
> > +endif
> >  
> 
> My own preference here would be to put the checks inside the
> subdirectories, and try and keep the top-level meson.build file clean.
> Would that work ok?

no objection. one clarification request though.

do you mean just for drivers, usertools and app or do you mean for every
lib/<foo> as well?

i'll send up a v2 once i get confirmation.

> 
> >  # build docs
> >  subdir('doc')
> > -- 
> > 1.8.3.1
> >
  
Bruce Richardson Jan. 26, 2023, 5:34 p.m. UTC | #3
On Thu, Jan 26, 2023 at 09:28:58AM -0800, Tyler Retzlaff wrote:
> On Thu, Jan 26, 2023 at 11:10:26AM +0000, Bruce Richardson wrote:
> > On Wed, Jan 25, 2023 at 11:25:07AM -0800, Tyler Retzlaff wrote:
> > > Build only kvargs and telemetry when is_ms_compiler.
> > > 
> > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > > ---
> > >  lib/meson.build |  7 +++++++
> > >  meson.build     | 13 +++++++++----
> > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/lib/meson.build b/lib/meson.build
> > > index 82e4666..8e99e21 100644
> > <snip>
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -76,11 +76,16 @@ subdir('config')
> > >  
> > >  # build libs and drivers
> > >  subdir('lib')
> > > -subdir('drivers')
> > >  
> > > -# build binaries and installable tools
> > > -subdir('usertools')
> > > -subdir('app')
> > > +if is_ms_compiler
> > > +    enabled_apps = []
> > > +else
> > > +    subdir('drivers')
> > > +
> > > +    # build binaries and installable tools
> > > +    subdir('usertools')
> > > +    subdir('app')
> > > +endif
> > >  
> > 
> > My own preference here would be to put the checks inside the
> > subdirectories, and try and keep the top-level meson.build file clean.
> > Would that work ok?
> 
> no objection. one clarification request though.
> 
> do you mean just for drivers, usertools and app or do you mean for every
> lib/<foo> as well?
> 

No, not for every lib, there are far too many of them. What you have done
there makes most sense. But for drivers/apps/usertools, putting the check
in the subfolder help keep the top-level file cleaner.
  
Tyler Retzlaff Jan. 26, 2023, 5:36 p.m. UTC | #4
On Thu, Jan 26, 2023 at 05:34:50PM +0000, Bruce Richardson wrote:
> On Thu, Jan 26, 2023 at 09:28:58AM -0800, Tyler Retzlaff wrote:
> > On Thu, Jan 26, 2023 at 11:10:26AM +0000, Bruce Richardson wrote:
> > > On Wed, Jan 25, 2023 at 11:25:07AM -0800, Tyler Retzlaff wrote:
> > > > Build only kvargs and telemetry when is_ms_compiler.
> > > > 
> > > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > > > ---
> > > >  lib/meson.build |  7 +++++++
> > > >  meson.build     | 13 +++++++++----
> > > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/lib/meson.build b/lib/meson.build
> > > > index 82e4666..8e99e21 100644
> > > <snip>
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -76,11 +76,16 @@ subdir('config')
> > > >  
> > > >  # build libs and drivers
> > > >  subdir('lib')
> > > > -subdir('drivers')
> > > >  
> > > > -# build binaries and installable tools
> > > > -subdir('usertools')
> > > > -subdir('app')
> > > > +if is_ms_compiler
> > > > +    enabled_apps = []
> > > > +else
> > > > +    subdir('drivers')
> > > > +
> > > > +    # build binaries and installable tools
> > > > +    subdir('usertools')
> > > > +    subdir('app')
> > > > +endif
> > > >  
> > > 
> > > My own preference here would be to put the checks inside the
> > > subdirectories, and try and keep the top-level meson.build file clean.
> > > Would that work ok?
> > 
> > no objection. one clarification request though.
> > 
> > do you mean just for drivers, usertools and app or do you mean for every
> > lib/<foo> as well?
> > 
> 
> No, not for every lib, there are far too many of them. What you have done
> there makes most sense. But for drivers/apps/usertools, putting the check
> in the subfolder help keep the top-level file cleaner.

thanks, i'll fire up v2 sometime today.
  

Patch

diff --git a/lib/meson.build b/lib/meson.build
index 82e4666..8e99e21 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -65,6 +65,13 @@  libraries = [
         'node',
 ]
 
+if is_ms_compiler
+    libraries = [
+            'kvargs',
+            'telemetry',
+    ]
+endif
+
 optional_libs = [
         'bitratestats',
         'cfgfile',
diff --git a/meson.build b/meson.build
index f91d652..e095192 100644
--- a/meson.build
+++ b/meson.build
@@ -76,11 +76,16 @@  subdir('config')
 
 # build libs and drivers
 subdir('lib')
-subdir('drivers')
 
-# build binaries and installable tools
-subdir('usertools')
-subdir('app')
+if is_ms_compiler
+    enabled_apps = []
+else
+    subdir('drivers')
+
+    # build binaries and installable tools
+    subdir('usertools')
+    subdir('app')
+endif
 
 # build docs
 subdir('doc')