[v8,10/10] build: meson changes to build on windows

Message ID 20190402035458.14664-11-anand.rawat@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series HelloWorld example for Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anand Rawat April 2, 2019, 3:54 a.m. UTC
  Added meson workarounds to build helloworld on Windows.
Windows currently only supports kvargs and eal libraries.
This change restricts the build flow to supported libraries
only.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 app/meson.build                        | 6 +++++-
 buildtools/meson.build                 | 6 +++++-
 drivers/meson.build                    | 6 +++++-
 examples/meson.build                   | 6 ++++--
 lib/librte_eal/windows/eal/meson.build | 6 ++++++
 lib/meson.build                        | 4 ++++
 6 files changed, 29 insertions(+), 5 deletions(-)
  

Comments

Thomas Monjalon April 2, 2019, 10:51 p.m. UTC | #1
02/04/2019 05:54, Anand Rawat:
> Added meson workarounds to build helloworld on Windows.
> Windows currently only supports kvargs and eal libraries.
> This change restricts the build flow to supported libraries
> only.
> 
> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
> --- a/examples/meson.build
> +++ b/examples/meson.build
> @@ -35,7 +35,9 @@ foreach example: examples
>  
>  	ext_deps = [execinfo]
>  	includes = [include_directories(example)]
> -	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
> +	if host_machine.system() == 'windows'
> +		deps = ['eal'] # only supported lib on Windows currently
> +	endif
>  	subdir(example)

This is not what I call keeping build intact for Linux/BSD :)

I did not catch it before because test-meson-builds.sh is not testing
compilation of the examples with meson. Bruce, may we add it?

I will add back the original deps line in master branch.
  
Anand Rawat April 2, 2019, 11:01 p.m. UTC | #2
On 4/2/2019 3:51 PM, Thomas Monjalon wrote:
> 02/04/2019 05:54, Anand Rawat:
>> Added meson workarounds to build helloworld on Windows.
>> Windows currently only supports kvargs and eal libraries.
>> This change restricts the build flow to supported libraries
>> only.
>>
>> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>> --- a/examples/meson.build
>> +++ b/examples/meson.build
>> @@ -35,7 +35,9 @@ foreach example: examples
>>   
>>   	ext_deps = [execinfo]
>>   	includes = [include_directories(example)]
>> -	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
>> +	if host_machine.system() == 'windows'
>> +		deps = ['eal'] # only supported lib on Windows currently
>> +	endif
>>   	subdir(example)
> 
> This is not what I call keeping build intact for Linux/BSD :)
> 
> I did not catch it before because test-meson-builds.sh is not testing
> compilation of the examples with meson. Bruce, may we add it?
> 
> I will add back the original deps line in master branch.
> 
> 

That is correct,
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
should have not been removed from this file. Please add the line
back.
  

Patch

diff --git a/app/meson.build b/app/meson.build
index aa353f657..e949624b7 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -1,5 +1,9 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
+
+if host_machine.system() == 'windows'
+	subdir_done()
+endif
 
 apps = [
 	'pdump',
diff --git a/buildtools/meson.build b/buildtools/meson.build
index cdd38ed24..0209bec8f 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -1,5 +1,9 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
+
+if host_machine.system() == 'windows'
+	subdir_done()
+endif
 
 subdir('pmdinfogen')
 
diff --git a/drivers/meson.build b/drivers/meson.build
index 8c76a5659..7520a16e3 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -1,5 +1,9 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
+
+if host_machine.system() == 'windows'
+	subdir_done()
+endif
 
 # Defines the order in which the drivers are buit.
 dpdk_driver_classes = ['common',
diff --git a/examples/meson.build b/examples/meson.build
index af81c762e..3bf1c2db8 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
 
 driver_libs = []
 if get_option('default_library') == 'static'
@@ -35,7 +35,9 @@  foreach example: examples
 
 	ext_deps = [execinfo]
 	includes = [include_directories(example)]
-	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+	if host_machine.system() == 'windows'
+		deps = ['eal'] # only supported lib on Windows currently
+	endif
 	subdir(example)
 
 	if build
diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/windows/eal/meson.build
index 6bc577e5c..e9b7138c5 100644
--- a/lib/librte_eal/windows/eal/meson.build
+++ b/lib/librte_eal/windows/eal/meson.build
@@ -5,6 +5,12 @@  eal_inc += include_directories('include')
 
 env_objs = []
 env_headers = []
+common_sources = files(
+	'../../common/eal_common_errno.c',
+	'../../common/eal_common_launch.c',
+	'../../common/eal_common_lcore.c',
+	'../../common/eal_common_log.c'
+)
 env_sources = files('eal.c',
 	'eal_debug.c',
 	'eal_lcore.c',
diff --git a/lib/meson.build b/lib/meson.build
index a7b5a9194..c3289f885 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,6 +30,10 @@  libraries = [
 	# flow_classify lib depends on pkt framework table lib
 	'flow_classify', 'bpf', 'telemetry']
 
+if host_machine.system() == 'windows'
+	libraries = ['kvargs','eal'] # only supported libraries for windows
+endif
+
 default_cflags = machine_args
 if cc.has_argument('-Wno-format-truncation')
 	default_cflags += '-Wno-format-truncation'