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

meson: supports version

- generate version header
This commit is contained in:
Vitalii Shylienkov
2020-04-13 12:47:07 +02:00
parent d603ccdc3b
commit 2a2a4d19c5
2 changed files with 11 additions and 1 deletions

View File

@@ -7,7 +7,8 @@
project('unity', 'c', project('unity', 'c',
license: 'MIT', license: 'MIT',
meson_version: '>=0.53.0', meson_version: '>=0.53.0',
default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'],
version: '2.5.0'
) )
lang = 'c' lang = 'c'
cc = meson.get_compiler(lang) cc = meson.get_compiler(lang)

View File

@@ -4,6 +4,15 @@
# #
# license: MIT # license: MIT
# #
conf_data = configuration_data()
conf_data.set('PROJECT_VERSION', meson.project_version())
conf_data.set('PROJECT_VERSION_MAJOR',meson.project_version().split('.')[0])
conf_data.set('PROJECT_VERSION_MINOR',meson.project_version().split('.')[1])
conf_data.set('PROJECT_VERSION_PATCH',meson.project_version().split('.')[2])
unity_version_template = join_paths(meson.source_root(), 'cmake/templates/unity_version.h.in')
unity_version_file =configure_file(input : unity_version_template,
output : 'unity_version.h',
configuration : conf_data)
unity_dir = include_directories('.') unity_dir = include_directories('.')
unity_lib = static_library(meson.project_name(), unity_lib = static_library(meson.project_name(),