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:
@@ -7,7 +7,8 @@
|
||||
project('unity', 'c',
|
||||
license: 'MIT',
|
||||
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'
|
||||
cc = meson.get_compiler(lang)
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
#
|
||||
# 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_lib = static_library(meson.project_name(),
|
||||
|
||||
Reference in New Issue
Block a user