|
1 | 1 | # SPDX-License-Identifier: BSD-3-Clause |
2 | 2 | # Copyright 2023 Intel Corporation |
3 | 3 |
|
4 | | -project('mtl_manager', 'cpp', default_options: ['buildtype=release', 'cpp_std=c++17'], version: '0.3.0') |
| 4 | +project('mtl_manager', 'cpp', default_options: ['buildtype=release', 'cpp_std=c++17'], |
| 5 | + version: run_command(find_program('cat'), files('../VERSION'), check: true).stdout().strip(), |
| 6 | +) |
5 | 7 |
|
6 | 8 | exec_env = host_machine.system() |
7 | 9 | set_variable('is_windows', exec_env == 'windows') |
@@ -34,6 +36,23 @@ if get_option('enable_asan') == true |
34 | 36 | asan_dep = cpp_c.find_library('asan', required : true) |
35 | 37 | endif |
36 | 38 |
|
| 39 | +mtlm_conf = configuration_data() |
| 40 | +# get external variables |
| 41 | +add_global_arguments('-D__MTLM_GIT__="'+ run_command('git', 'describe', '--abbrev=8', '--dirty', '--always', check: false).stdout().strip() + '"', language : 'cpp') |
| 42 | +# parse mtlm config |
| 43 | +# parse build config |
| 44 | +prj_ver = meson.project_version().split('.') |
| 45 | +mtlm_conf.set('MTLM_VERSION_MAJOR', prj_ver.get(0).to_int()) |
| 46 | +mtlm_conf.set('MTLM_VERSION_MINOR', prj_ver.get(1).to_int()) |
| 47 | +mtlm_conf.set('MTLM_VERSION_LAST', prj_ver.get(2).to_int()) |
| 48 | +mtlm_conf.set_quoted('MTLM_VERSION_EXTRA', prj_ver.get(3)) |
| 49 | +# parse compiler config |
| 50 | +cpp_c_ver = cpp_c.get_id() + '-' + cpp_c.version() |
| 51 | +mtlm_conf.set_quoted('MTLM_COMPILER', cpp_c_ver) |
| 52 | +# build config file |
| 53 | +build_cfg = 'mtlm_build_config.h' |
| 54 | +configure_file(output: build_cfg, configuration: mtlm_conf) |
| 55 | + |
37 | 56 | # xdp check |
38 | 57 | libxdp_dep = dependency('libxdp', required: false) |
39 | 58 | libbpf_dep = dependency('libbpf', required: false) |
|
0 commit comments