mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-12 20:05:34 +00:00
`VERSION.md` is in the root of the source directory. However, when building a Linux package from a source package we can't access files from the root directory. Prior to creating the source package `VERSION.md` gets copied to `common/core/desktop` so that it is available in the source package. However, this hack broke the meson build everywhere else unless `VERSION.md` got copied manually. This change uses `VERSION.md` from the root directory if it is available and otherwise assumes that it exists in the same directory as the `meson.build` script. This change also switches to using scripts to get the version number rather than doing it in the meson build itself because that gives more flexibility. It is important to note that the Windows batch file has to be listed first in `find_program` because Windows might detect `getversion.sh` and tries to run it with bash but this fails because of the different directory separators.
29 lines
824 B
Meson
29 lines
824 B
Meson
# Copyright: © 2018-2020 SIL International.
|
|
# Description: Cross platform build script to compile libkmnkbp, documentation
|
|
# and tests.
|
|
# Create Date: 2 Oct 2018
|
|
# Authors: Tim Eves (TSE)
|
|
#
|
|
|
|
project('keyboardprocessor', 'cpp', 'c',
|
|
version: run_command(find_program('getversion.bat', 'getversion.sh')).stdout().strip(),
|
|
license: 'MIT',
|
|
default_options : ['buildtype=release',
|
|
'cpp_std=c++14'])
|
|
|
|
message('meson.project_version(): ' + meson.project_version() + '\n')
|
|
compiler = meson.get_compiler('cpp')
|
|
|
|
lib_version = '0.0.0'
|
|
|
|
if compiler.get_id() == 'msvc'
|
|
add_global_arguments('/source-charset:utf-8', language: ['c', 'cpp'])
|
|
endif
|
|
|
|
py = import('python3')
|
|
python = py.find_python()
|
|
|
|
subdir('doc')
|
|
subdir('include')
|
|
subdir('src')
|
|
subdir('tests')
|