|
| 1 | +# |
| 2 | +# Taken from meson.build of systemd |
| 3 | +# |
| 4 | + |
| 5 | +# SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | + |
| 7 | +project('systemd', 'c', |
| 8 | + version : files('meson.version'), |
| 9 | + license : 'LGPLv2+', |
| 10 | + default_options: [ |
| 11 | + 'c_std=gnu11', |
| 12 | + 'prefix=/usr', |
| 13 | + 'sysconfdir=/etc', |
| 14 | + 'localstatedir=/var', |
| 15 | + 'warning_level=2', |
| 16 | + ], |
| 17 | + meson_version : '>= 0.60.0', |
| 18 | + ) |
| 19 | + |
| 20 | +project_major_version = meson.project_version().split('.')[0].split('~')[0] |
| 21 | +if meson.project_version().contains('.') |
| 22 | + project_minor_version = meson.project_version().split('.')[-1].split('~')[0] |
| 23 | +else |
| 24 | + project_minor_version = '0' |
| 25 | +endif |
| 26 | + |
| 27 | +libsystemd_version = '0.39.0' |
| 28 | +libudev_version = '1.7.9' |
| 29 | + |
| 30 | +conf = configuration_data() |
| 31 | +conf.set_quoted('PROJECT_URL', 'https://systemd.io/') |
| 32 | +conf.set('PROJECT_VERSION', project_major_version, |
| 33 | + description : 'Numerical project version (used where a simple number is expected)') |
| 34 | +conf.set_quoted('PROJECT_VERSION_FULL', meson.project_version(), description : 'Full project version') |
| 35 | + |
| 36 | +conf2 = configuration_data() |
| 37 | +conf2.set_quoted('PROJECT_URL_ALT', 'https://systemd.io/') |
| 38 | + |
| 39 | +# This is to be used instead of meson.source_root(), as the latter will return |
| 40 | +# the wrong result when systemd is being built as a meson subproject |
| 41 | +project_source_root = meson.current_source_dir() |
| 42 | +project_build_root = meson.current_build_dir() |
| 43 | +relative_source_path = run_command('realpath', |
| 44 | + '--relative-to=@0@'.format(project_build_root), |
| 45 | + project_source_root, |
| 46 | + check : true).stdout().strip() |
| 47 | +conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) |
| 48 | + |
| 49 | +conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer', |
| 50 | + description : 'tailor build to development or release builds') |
0 commit comments