spiegel-keyman/core/meson.build
Marc Durdin 808b6557d6 maint(common): use cpp_std=c++17 in meson project default_options
We attempted to set the C++ version in standard.meson.build, but this
does not work well as the option name varies by platform, and it also
triggers a warning in meson. This fix moves the setting into each
meson.build project() default_options. As there are only a handful
of these, the maintenance burden is not high.

Fixes: #14432
Relates-to: #14355
Build-bot: build
Test-bot: skip
2025-08-01 10:23:57 +10:00

49 lines
1.6 KiB
Meson

# Copyright: © 2018-2022 SIL International.
# Description: Cross platform build script to compile libkeymancore, documentation
# and tests.
# Create Date: 2 Oct 2018
# Authors: Tim Eves (TSE)
#
project('keyman_core', 'cpp', 'c',
version: files('../VERSION.md'),
license: 'MIT',
default_options : ['buildtype=release',
'cpp_std=c++17',
'b_vscrt=static_from_buildtype',
'warning_level=2',
'debug=true'],
meson_version: '>=1.0')
# Import our standard compiler defines; this is copied from
# /resources/build/standard.meson.build by build.sh, because
# meson doesn't allow us to reference a file outside its root
subdir('resources')
fs = import('fs')
lib_version = fs.read('CORE_API_VERSION.md').strip()
py = import('python')
python = py.find_installation()
# TODO: Shared includes may use namespaces, etc which need future tidyup.
# For now, we use KM_CORE_LIBRARY to inject the km::core::kmx namespace
defns += ['-DKM_CORE_LIBRARY']
# #define DEBUG when we are on a debug build
if get_option('buildtype') == 'debug'
add_global_arguments('-DDEBUG', language : 'cpp')
endif
# shared with a number of subdirs
if cpp_compiler.get_id() == 'emscripten'
wasm_exported_runtime_methods = '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\',\'stringToNewUTF8\',\'wasmExports\']'
# For Google Test
add_global_arguments('-pthread', language: [ 'cpp', 'c' ] )
endif
subdir('docs/internal')
subdir('include')
subdir('src')
subdir('tests')