[v1,1/4] app/test-pmd-api: Add C++ Compiler

Message ID 20220407214707.29730-2-ohilyard@iol.unh.edu (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series Testpmd RPC API |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing fail build patch failure

Commit Message

Owen Hilyard April 7, 2022, 9:47 p.m. UTC
  From: Owen Hilyard <ohilyard@iol.unh.edu>

Adds a C++ compiler to the project, which is currently enabled by
default for ease of testing. Meson currently lacks a way to try to get a
compiler, and failing to find a compiler for a language always causes a
hard error, so this is the only workable approach.

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
---
 meson.build       | 3 +++
 meson_options.txt | 2 ++
 2 files changed, 5 insertions(+)
  

Comments

Stephen Hemminger Oct. 2, 2023, 6:33 p.m. UTC | #1
On Thu,  7 Apr 2022 17:47:05 -0400
ohilyard@iol.unh.edu wrote:

> From: Owen Hilyard <ohilyard@iol.unh.edu>
> 
> Adds a C++ compiler to the project, which is currently enabled by
> default for ease of testing. Meson currently lacks a way to try to get a
> compiler, and failing to find a compiler for a language always causes a
> hard error, so this is the only workable approach.
> 
> Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>

This patch has a problem.
What ever editor you used failed to add a end of line (newline)
on the last line of the file. Git accepts this but complains, other tools
do not handle it well.

Pleas rebase and fix the series.
  

Patch

diff --git a/meson.build b/meson.build
index 937f6110c0..01d47100f2 100644
--- a/meson.build
+++ b/meson.build
@@ -31,6 +31,9 @@  endif
 
 # set up some global vars for compiler, platform, configuration, etc.
 cc = meson.get_compiler('c')
+if get_option('use_cpp')
+    cxx = meson.get_compiler('cpp')
+endif
 dpdk_source_root = meson.current_source_dir()
 dpdk_build_root = meson.current_build_dir()
 dpdk_conf = configuration_data()
diff --git a/meson_options.txt b/meson_options.txt
index 7c220ad68d..9461d194a1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -48,3 +48,5 @@  option('tests', type: 'boolean', value: true, description:
        'build unit tests')
 option('use_hpet', type: 'boolean', value: false, description:
        'use HPET timer in EAL')
+option('use_cpp', type: 'boolean', value: true, description: 
+       'enable components requiring a C++ compiler.')
\ No newline at end of file