1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

Updates to Meson build system:

1. Use cross-platform `/` operator for path construction.

2. Use `meson.project_source_root()` for correct path resolution of
   generate_test_runner.rb path when used as a subproject.

3. Bump the minimum required Meson version to '0.56.0' as this is
   needed for the above changes.
This commit is contained in:
Andrew McNulty
2023-02-13 15:55:47 +01:00
parent 5204c1bacf
commit 699a391c78

View File

@@ -6,20 +6,21 @@
# #
project('unity', 'c', project('unity', 'c',
license: 'MIT', license: 'MIT',
meson_version: '>=0.37.0', # `meson.project_source_root()` introduced in 0.56.0
default_options: ['werror=true', 'c_std=c11']) meson_version: '>=0.56.0',
default_options: [
'werror=true',
'c_std=c11'
]
)
subdir('src') subdir('src')
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir) unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
# Create a generator that can be used by consumers of our build system to generate
# Get the generate_test_runner script relative to itself or the parent project if it is being used as a subproject # test runners.
# NOTE: This could be (and probably is) a complete hack - but I haven't yet been able to find a better way.... gen_test_runner = generator(
if meson.is_subproject() find_program(meson.project_source_root() / 'auto' / 'generate_test_runner.rb'),
gen_test_runner_path = find_program(meson.source_root() / 'subprojects/unity/auto/generate_test_runner.rb') output: '@BASENAME@_Runner.c',
else arguments: ['@INPUT@', '@OUTPUT@']
gen_test_runner_path = find_program('subprojects/unity/auto/generate_test_runner.rb') )
endif
# Create a generator that we can access from the parent project
gen_test_runner = generator(gen_test_runner_path, output: '@BASENAME@_Runner.c', arguments: ['@INPUT@', '@OUTPUT@'] )