mirror of
https://git.yoctoproject.org/poky
synced 2026-02-09 02:03:04 +01:00
This simple C++ project supports compilation with CMake and Meson. (Autotool support could be added later on.) It's supposed to be used with oe-selftest. An artificial project has several advantages over compiling a normal CMake or Meson based project for testing purposes: - It is much faster because it can be kept minimalistic - It can cover multiple odd corner cases - No one will change it in an unpredictable way - It can support multiple build tools with only one C++ codebase (From OE-Core rev: 4904e772470b0d6e5d98ef0344b3f2bf54214661) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
39 lines
821 B
Meson
39 lines
821 B
Meson
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
project('meson-example', 'cpp',
|
|
version: '1.0.0',
|
|
default_options: ['cpp_std=c++17']
|
|
)
|
|
|
|
jsoncdep = dependency('json-c')
|
|
|
|
if get_option('FAILING_TEST').enabled()
|
|
add_project_arguments('-DFAIL_COMPARISON_STR=foo', language: 'cpp')
|
|
endif
|
|
|
|
mesonexlib = shared_library('mesonexlib',
|
|
'cpp-example-lib.cpp', 'cpp-example-lib.hpp',
|
|
version: meson.project_version(),
|
|
soversion: meson.project_version().split('.')[0],
|
|
dependencies : jsoncdep,
|
|
install : true
|
|
)
|
|
|
|
executable('mesonex',
|
|
'cpp-example.cpp',
|
|
link_with : mesonexlib,
|
|
install : true
|
|
)
|
|
|
|
test_mesonex = executable('test-mesonex',
|
|
'test-cpp-example.cpp',
|
|
link_with : mesonexlib,
|
|
install : true
|
|
)
|
|
|
|
test('meson example test', test_mesonex)
|