Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | project('meson-example', 'cpp', |
| 8 | version: '1.0.0', |
| 9 | default_options: ['cpp_std=c++17'] |
| 10 | ) |
| 11 | |
| 12 | jsoncdep = dependency('json-c') |
| 13 | |
| 14 | if get_option('FAILING_TEST').enabled() |
| 15 | add_project_arguments('-DFAIL_COMPARISON_STR=foo', language: 'cpp') |
| 16 | endif |
| 17 | |
| 18 | mesonexlib = shared_library('mesonexlib', |
| 19 | 'cpp-example-lib.cpp', 'cpp-example-lib.hpp', |
| 20 | version: meson.project_version(), |
| 21 | soversion: meson.project_version().split('.')[0], |
| 22 | dependencies : jsoncdep, |
| 23 | install : true |
| 24 | ) |
| 25 | |
| 26 | executable('mesonex', |
| 27 | 'cpp-example.cpp', |
| 28 | link_with : mesonexlib, |
| 29 | install : true |
| 30 | ) |
| 31 | |
| 32 | test_mesonex = executable('test-mesonex', |
| 33 | 'test-cpp-example.cpp', |
| 34 | link_with : mesonexlib, |
| 35 | install : true |
| 36 | ) |
| 37 | |
| 38 | test('meson example test', test_mesonex) |