From patchwork Fri Sep 14 13:54:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 44727 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A14375F32; Fri, 14 Sep 2018 15:54:26 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1CD1A5F24 for ; Fri, 14 Sep 2018 15:54:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2018 06:54:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,373,1531810800"; d="scan'208";a="257257226" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by orsmga005.jf.intel.com with ESMTP; 14 Sep 2018 06:54:19 -0700 From: David Hunt To: dev@dpdk.org Cc: john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com, bruce.richardson@intel.com, David Hunt Date: Fri, 14 Sep 2018 14:54:04 +0100 Message-Id: <20180914135406.52190-7-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180914135406.52190-1-david.hunt@intel.com> References: <20180912144930.50578-1-david.hunt@intel.com> <20180914135406.52190-1-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v3 6/8] examples/power: add meson/ninja build support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add meson.build in vm_power_manager and the guest_cli subdirectory. Building can be achieved by going to the build directory, and using meson configure -Dexamples=vm_power_manager,vm_power_manager/guest_cli Then, when ninja is invoked, it will build dpdk-vm_power_manger and dpdk-guest_cli Work still needs to be done on the meson build system to handles the case where the target list of example apps is defined as 'all'. That will come in a future patch. Signed-off-by: David Hunt Acked-by: Bruce Richardson --- .../vm_power_manager/guest_cli/meson.build | 21 +++++++++++ examples/vm_power_manager/meson.build | 37 ++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 examples/vm_power_manager/guest_cli/meson.build diff --git a/examples/vm_power_manager/guest_cli/meson.build b/examples/vm_power_manager/guest_cli/meson.build new file mode 100644 index 000000000..9e821ceb8 --- /dev/null +++ b/examples/vm_power_manager/guest_cli/meson.build @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +# meson file, for building this example as part of a main DPDK build. +# +# To build this example as a standalone application with an already-installed +# DPDK instance, use 'make' + +# Setting the name here because the default name will conflict with the +# vm_power_manager app because of the way the directories are parsed. +name = 'guest_cli' + +deps += ['power'] + +sources = files( + 'main.c', 'parse.c', 'vm_power_cli_guest.c' +) + +opt_dep = cc.find_library('virt', required : false) +build = opt_dep.found() +ext_deps += opt_dep diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build index c370d7476..f98445bc6 100644 --- a/examples/vm_power_manager/meson.build +++ b/examples/vm_power_manager/meson.build @@ -6,5 +6,38 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -# Example app currently unsupported by meson build -build = false +if dpdk_conf.has('RTE_LIBRTE_BNXT_PMD') + deps += ['pmd_bnxt'] +endif + +if dpdk_conf.has('RTE_LIBRTE_I40E_PMD') + deps += ['pmd_i40e'] +endif + +if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD') + deps += ['pmd_ixgbe'] +endif + +deps += ['power'] + + +sources = files( + 'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c' +) + +# If we're on X86, pull in the x86 code for the branch monitor algo. +if dpdk_conf.has('RTE_ARCH_X86_64') + sources += files('oob_monitor_x86.c') +else + sources += files('oob_monitor_nop.c') +endif + +opt_dep = cc.find_library('virt', required : false) +build = opt_dep.found() +ext_deps += opt_dep + +opt_dep = dependency('jansson', required : false) +if opt_dep.found() + ext_deps += opt_dep + cflags += '-DUSE_JANSSON' +endif