mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
100 lines
2.3 KiB
Meson
100 lines
2.3 KiB
Meson
# Copyright: © 2018-2022 SIL International.
|
|
# Description: Cross platform build script to compile libkmnkbp.
|
|
# Create Date: 2 Oct 2018
|
|
# Authors: Tim Eves (TSE)
|
|
#
|
|
|
|
version_res = []
|
|
|
|
# TODO: shouldn't this be defined only for dylib and not static lib?
|
|
defns += ['-DKMN_KBP_EXPORTING']
|
|
|
|
if cpp_compiler.get_id() == 'msvc'
|
|
defns += ['-DUNICODE']
|
|
# /n = append null
|
|
# /c65001 = utf-8 file format
|
|
version_res += import('windows').compile_resources('version.rc', args:['/n','/c65001'])
|
|
endif
|
|
|
|
if cpp_compiler.get_id() == 'emscripten'
|
|
# TODO: why do we need this defn here?
|
|
defns += ['-DKMN_KBP']
|
|
endif
|
|
|
|
kmx_files = files(
|
|
'option.cpp',
|
|
'keyboard.cpp',
|
|
'state.cpp',
|
|
'debuglog.cpp',
|
|
'km_kbp_context_api.cpp',
|
|
'km_kbp_keyboard_api.cpp',
|
|
'km_kbp_options_api.cpp',
|
|
'km_kbp_state_api.cpp',
|
|
'km_kbp_debug_api.cpp',
|
|
'km_kbp_processevent_api.cpp',
|
|
'jsonpp.cpp',
|
|
'ldml/ldml_processor.cpp',
|
|
'ldml/ldml_transforms.cpp',
|
|
'ldml/ldml_vkeys.cpp',
|
|
'mock/mock_processor.cpp',
|
|
'kmx/kmx_consts.cpp',
|
|
'kmx/kmx_processevent.cpp',
|
|
'kmx/kmx_actions.cpp',
|
|
'kmx/kmx_capslock.cpp',
|
|
'kmx/kmx_context.cpp',
|
|
'kmx/kmx_conversion.cpp',
|
|
'kmx/kmx_debugger.cpp',
|
|
'kmx/kmx_environment.cpp',
|
|
'kmx/kmx_file.cpp',
|
|
'kmx/kmx_modifiers.cpp',
|
|
'kmx/kmx_options.cpp',
|
|
'kmx/kmx_plus.cpp',
|
|
'kmx/kmx_processor.cpp',
|
|
'kmx/kmx_xstring.cpp',
|
|
)
|
|
|
|
api_files = files(
|
|
'km_kbp_context_api.cpp',
|
|
'km_kbp_keyboard_api.cpp',
|
|
'km_kbp_options_api.cpp',
|
|
'km_kbp_state_api.cpp',
|
|
'km_kbp_debug_api.cpp',
|
|
'km_kbp_processevent_api.cpp',
|
|
)
|
|
|
|
core_files = files(
|
|
'option.cpp',
|
|
'keyboard.cpp',
|
|
'state.cpp',
|
|
'jsonpp.cpp',
|
|
'utfcodec.cpp',
|
|
)
|
|
|
|
mock_files = files(
|
|
'mock/mock_processor.cpp',
|
|
)
|
|
|
|
lib = library('kmnkbp0',
|
|
api_files,
|
|
core_files,
|
|
kmx_files,
|
|
mock_files,
|
|
version_res,
|
|
cpp_args: defns + warns + flags,
|
|
link_args: links,
|
|
version: lib_version,
|
|
include_directories: inc,
|
|
pic: true,
|
|
install: true)
|
|
|
|
headerdirs = [ '.', 'keyman' ] # subdirectories of ${prefix}/include to add to header path
|
|
|
|
kmnkbp = declare_dependency(link_with: lib, include_directories: inc)
|
|
|
|
pkg = import('pkgconfig')
|
|
pkg.generate(
|
|
name: 'keyman_kmn_processor',
|
|
version: meson.project_version(),
|
|
description: 'Keyman processor for KMN keyboards.',
|
|
subdirs: headerdirs,
|
|
libraries: lib)
|