On Fri, Mar 22, 2019 at 03:55:05PM -0700, Anand Rawat wrote:
> 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.ra...@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.ka...@intel.com>
> Reviewed-by: Jeff Shaw <jeffrey.b.s...@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.me...@intel.com>
> ---

Comments inline below.
/Bruce

>  app/meson.build                   |   6 +-
>  buildtools/meson.build            |   6 +-
>  doc/meson.build                   |   5 +
>  drivers/meson.build               |   6 +-
>  examples/meson.build              |   6 +-
>  kernel/meson.build                |   6 +-
>  lib/librte_eal/common/meson.build | 159 ++++++++++++++++--------------
>  lib/meson.build                   |   4 +
>  usertools/meson.build             |   6 +-
>  9 files changed, 124 insertions(+), 80 deletions(-)
> 
> 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/doc/meson.build b/doc/meson.build
> index c5410d85d..20c74ee36 100644
> --- a/doc/meson.build
> +++ b/doc/meson.build
> @@ -1,5 +1,10 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2018 Luca Boccassi <bl...@debian.org>
> +# Copyright(c) 2019 Intel Corporation
> +
> +if host_machine.system() == 'windows'
> +     subdir_done()
> +endif
>  

This isn't really necessary, I think, since the docs are not built by
default. I think we should just document the fact that you can't turn on
the doc building in windows.

>  doc_targets = []
>  doc_target_names = []
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 69d0556d3..33d1503f3 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.
>  driver_classes = ['common',
> diff --git a/examples/meson.build b/examples/meson.build
> index af81c762e..107e378e7 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']
> +     endif
>       subdir(example)
>  
>       if build
> diff --git a/kernel/meson.build b/kernel/meson.build
> index 2c8fa76d0..a7ab219d2 100644
> --- a/kernel/meson.build
> +++ b/kernel/meson.build
> @@ -1,4 +1,8 @@
>  # 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
>  

I think a better fix here is to create a windows subdirectory and put an
empty meson.build file there. Alternatively just document that for windows
you need to disable kernel module building.

>  subdir(host_machine.system())
> diff --git a/lib/librte_eal/common/meson.build 
> b/lib/librte_eal/common/meson.build
> index 5ecae0b1f..05ebd06b6 100644
> --- a/lib/librte_eal/common/meson.build
> +++ b/lib/librte_eal/common/meson.build
> @@ -1,91 +1,102 @@
>  # 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_headers = []
> +
>  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',
> -     'eal_common_options.c',
> -     'eal_common_proc.c',
> -     'eal_common_string_fns.c',
> -     'eal_common_tailqs.c',
> -     'eal_common_thread.c',
> -     'eal_common_timer.c',
> -     'eal_common_uuid.c',
> -     'hotplug_mp.c',
> -     'malloc_elem.c',
> -     'malloc_heap.c',
> -     'malloc_mp.c',
> -     'rte_keepalive.c',
> -     'rte_malloc.c',
> -     'rte_option.c',
> -     'rte_reciprocal.c',
> -     'rte_service.c'
> -)
> +             '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_fbarray.c',
> +             'eal_common_hexdump.c',
> +             'eal_common_hypervisor.c',
> +             'eal_common_memalloc.c',
> +             'eal_common_memory.c',
> +             'eal_common_memzone.c',
> +             'eal_common_options.c',
> +             'eal_common_proc.c',
> +             'eal_common_string_fns.c',
> +             'eal_common_tailqs.c',
> +             'eal_common_thread.c',
> +             'eal_common_timer.c',
> +             'eal_common_uuid.c',
> +             'hotplug_mp.c',
> +             'malloc_elem.c',
> +             'malloc_heap.c',
> +             'malloc_mp.c',
> +             'rte_keepalive.c',
> +             'rte_malloc.c',
> +             'rte_option.c',
> +             'rte_reciprocal.c',
> +             'rte_service.c'
> +     )
> +endif
>  
>  # get architecture specific sources and objs
>  eal_common_arch_sources = []
>  eal_common_arch_objs = []
> -subdir(join_paths('arch', arch_subdir))
> +
> +common_headers += files(
> +             'include/rte_branch_prediction.h',
> +             'include/rte_bus.h',
> +             'include/rte_common.h',
> +             'include/rte_debug.h',
> +             'include/rte_dev.h',
> +             'include/rte_eal.h',
> +             'include/rte_errno.h',
> +             'include/rte_launch.h',
> +             'include/rte_lcore.h',
> +             'include/rte_log.h',
> +             'include/rte_memory.h',
> +             'include/rte_pci_dev_feature_defs.h',
> +             'include/rte_per_lcore.h',
> +             'include/rte_string_fns.h'
> +     )

Why is the common_headers list split into two? The headers should need no
adjustment in order to get things building, the header lists are only used
for the install phase, not the build one.

> +if host_machine.system() != 'windows'
> +     subdir(join_paths('arch', arch_subdir))
> +endif
>  common_sources += eal_common_arch_sources
>  common_objs += eal_common_arch_objs
>  
> -common_headers = files(
> -     'include/rte_alarm.h',
> -     'include/rte_branch_prediction.h',
> -     'include/rte_bus.h',
> -     'include/rte_bitmap.h',
> -     'include/rte_class.h',
> -     'include/rte_common.h',
> -     'include/rte_compat.h',
> -     'include/rte_debug.h',
> -     'include/rte_devargs.h',
> -     'include/rte_dev.h',
> -     'include/rte_eal.h',
> -     'include/rte_eal_memconfig.h',
> -     'include/rte_eal_interrupts.h',
> -     'include/rte_errno.h',
> -     'include/rte_fbarray.h',
> -     'include/rte_hexdump.h',
> -     'include/rte_hypervisor.h',
> -     'include/rte_interrupts.h',
> -     'include/rte_keepalive.h',
> -     'include/rte_launch.h',
> -     'include/rte_lcore.h',
> -     'include/rte_log.h',
> -     'include/rte_malloc.h',
> -     'include/rte_malloc_heap.h',
> -     'include/rte_memory.h',
> -     'include/rte_memzone.h',
> -     'include/rte_option.h',
> -     'include/rte_pci_dev_feature_defs.h',
> -     'include/rte_pci_dev_features.h',
> -     'include/rte_per_lcore.h',
> -     'include/rte_random.h',
> -     'include/rte_reciprocal.h',
> -     'include/rte_service.h',
> -     'include/rte_service_component.h',
> -     'include/rte_string_fns.h',
> -     'include/rte_tailq.h',
> -     'include/rte_time.h',
> -     'include/rte_uuid.h',
> -     'include/rte_version.h')
> +common_headers += files(
> +             'include/rte_alarm.h',
> +             'include/rte_bitmap.h',
> +             'include/rte_class.h',
> +             'include/rte_compat.h',
> +             'include/rte_devargs.h',
> +             'include/rte_eal_memconfig.h',
> +             'include/rte_eal_interrupts.h',
> +             'include/rte_fbarray.h',
> +             'include/rte_hexdump.h',
> +             'include/rte_hypervisor.h',
> +             'include/rte_interrupts.h',
> +             'include/rte_keepalive.h',
> +             'include/rte_malloc.h',
> +             'include/rte_malloc_heap.h',
> +             'include/rte_memzone.h',
> +             'include/rte_option.h',
> +             'include/rte_pci_dev_features.h',
> +             'include/rte_random.h',
> +             'include/rte_reciprocal.h',
> +             'include/rte_service.h',
> +             'include/rte_service_component.h',
> +             'include/rte_tailq.h',
> +             'include/rte_time.h',
> +             'include/rte_uuid.h',
> +             'include/rte_version.h')
>  
>  # special case install the generic headers, since they go in a subdir
>  generic_headers = files(
> diff --git a/lib/meson.build b/lib/meson.build
> index 1fe1b4677..8d7711090 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'
> diff --git a/usertools/meson.build b/usertools/meson.build
> index 149e788e3..a00fcaa6a 100644
> --- a/usertools/meson.build
> +++ b/usertools/meson.build
> @@ -1,4 +1,8 @@
>  # 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
> 

This change is unnecessary, as there is no build work being done here, just
configuring files for installation.

>  install_data(['dpdk-devbind.py', 'dpdk-pmdinfo.py'], install_dir: 'bin')
> -- 
> 2.17.1.windows.2
>

Reply via email to