[v6,8/8] build: meson changes to build on windows
Checks
Commit Message
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 +++++-
kernel/windows/meson.build | 4 ++++
lib/librte_eal/common/meson.build | 14 +++++++++-----
lib/meson.build | 4 ++++
7 files changed, 37 insertions(+), 9 deletions(-)
create mode 100644 kernel/windows/meson.build
Comments
28/03/2019 03:21, 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.
It is OK to merge few limited workarounds in the master branch,
in order to start compiling something on Windows,
and regularly check that the work done is not broken
by other patches coming in.
It will be especially useful if we manage to have a CI for Windows.
> --- a/lib/librte_eal/common/meson.build
> +++ b/lib/librte_eal/common/meson.build
> common_objs = []
> +common_sources = files(
> + 'eal_common_errno.c',
> + 'eal_common_launch.c',
> + 'eal_common_lcore.c',
> + 'eal_common_log.c'
> + )
> +if host_machine.system() != 'windows'
> common_sources = files(
> 'eal_common_bus.c',
> 'eal_common_cpuflags.c',
> 'eal_common_class.c',
> 'eal_common_devargs.c',
> 'eal_common_dev.c',
> - 'eal_common_errno.c',
> 'eal_common_fbarray.c',
> 'eal_common_hexdump.c',
> 'eal_common_hypervisor.c',
> - 'eal_common_launch.c',
> - 'eal_common_lcore.c',
> - 'eal_common_log.c',
> 'eal_common_memalloc.c',
> 'eal_common_memory.c',
> 'eal_common_memzone.c',
> @@ -38,6 +41,7 @@ common_sources = files(
> 'rte_reciprocal.c',
> 'rte_service.c'
> )
> +endif
As discussed over the phone, it would be better to overwrite this list
and keep the original one as is.
Thanks
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Anand Rawat
Sent: Wednesday, March 27, 2019 7:21 PM
To: dev@dpdk.org
Cc: anand.rawat@intel.com; pallavi.kadam@intel.com; ranjit.menon@intel.com; jeffrey.b.shaw@intel.com; bruce.richardson@intel.com; thomas@monjalon.net
Subject: [dpdk-dev] [PATCH v6 8/8] build: meson changes to build on windows
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 +++++-
kernel/windows/meson.build | 4 ++++
lib/librte_eal/common/meson.build | 14 +++++++++-----
lib/meson.build | 4 ++++
7 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 kernel/windows/meson.build
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..bc1430fa8 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -35,7 +35,11 @@ foreach example: examples
ext_deps = [execinfo]
includes = [include_directories(example)]
- deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+ if host_machine.system() != 'windows'
+ deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+ else
+ deps = ['eal'] # only supported lib on windows currently
+ endif
subdir(example)
if build
diff --git a/kernel/windows/meson.build b/kernel/windows/meson.build new file mode 100644 index 000000000..c4a2a656a
--- /dev/null
+++ b/kernel/windows/meson.build
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation
+
+# stub file for supporting windows logic in future release
\ No newline at end of file
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
index 5ecae0b1f..e9021c00c 100644
--- a/lib/librte_eal/common/meson.build
+++ b/lib/librte_eal/common/meson.build
@@ -1,23 +1,26 @@
# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
eal_inc += include_directories('.', 'include',
join_paths('include/arch', arch_subdir))
common_objs = []
+common_sources = files(
+ 'eal_common_errno.c',
+ 'eal_common_launch.c',
+ 'eal_common_lcore.c',
+ 'eal_common_log.c'
+ )
+if host_machine.system() != 'windows'
common_sources = files(
'eal_common_bus.c',
'eal_common_cpuflags.c',
'eal_common_class.c',
'eal_common_devargs.c',
'eal_common_dev.c',
- 'eal_common_errno.c',
'eal_common_fbarray.c',
'eal_common_hexdump.c',
'eal_common_hypervisor.c',
- 'eal_common_launch.c',
- 'eal_common_lcore.c',
- 'eal_common_log.c',
'eal_common_memalloc.c',
'eal_common_memory.c',
'eal_common_memzone.c',
@@ -38,6 +41,7 @@ common_sources = files(
'rte_reciprocal.c',
'rte_service.c'
)
+endif
# get architecture specific sources and objs eal_common_arch_sources = [] diff --git a/lib/meson.build b/lib/meson.build index 9cba4662e..d3e556ae3 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'] # override libraries for windows endif
+
default_cflags = machine_args
if cc.has_argument('-Wno-format-truncation')
default_cflags += '-Wno-format-truncation'
--
2.17.1.windows.2
@@ -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',
@@ -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')
@@ -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',
@@ -35,7 +35,11 @@ foreach example: examples
ext_deps = [execinfo]
includes = [include_directories(example)]
- deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+ if host_machine.system() != 'windows'
+ deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+ else
+ deps = ['eal'] # only supported lib on windows currently
+ endif
subdir(example)
if build
new file mode 100644
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# stub file for supporting windows logic in future release
\ No newline at end of file
@@ -1,23 +1,26 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
eal_inc += include_directories('.', 'include',
join_paths('include/arch', arch_subdir))
common_objs = []
+common_sources = files(
+ 'eal_common_errno.c',
+ 'eal_common_launch.c',
+ 'eal_common_lcore.c',
+ 'eal_common_log.c'
+ )
+if host_machine.system() != 'windows'
common_sources = files(
'eal_common_bus.c',
'eal_common_cpuflags.c',
'eal_common_class.c',
'eal_common_devargs.c',
'eal_common_dev.c',
- 'eal_common_errno.c',
'eal_common_fbarray.c',
'eal_common_hexdump.c',
'eal_common_hypervisor.c',
- 'eal_common_launch.c',
- 'eal_common_lcore.c',
- 'eal_common_log.c',
'eal_common_memalloc.c',
'eal_common_memory.c',
'eal_common_memzone.c',
@@ -38,6 +41,7 @@ common_sources = files(
'rte_reciprocal.c',
'rte_service.c'
)
+endif
# get architecture specific sources and objs
eal_common_arch_sources = []
@@ -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'] # override libraries for windows
+endif
+
default_cflags = machine_args
if cc.has_argument('-Wno-format-truncation')
default_cflags += '-Wno-format-truncation'