wrenpp/meson.build
King_DuckZ 5d6575f328 Add make_foreign_object() overload
It's only available when users define WRENPP_WITH_NAME_GUESSING
and it automatically retrieves the class name of T using
new code in guess_class_name.hpp. Only tested on gcc so far.
Microsoft compiler doesn't seem to understand consteval keyword.
2022-04-29 12:34:01 +02:00

78 lines
1.7 KiB
Meson

project('wrenpp', 'cpp',
version: '0.1.2',
meson_version: '>=0.49.2',
default_options: ['buildtype=release', 'cpp_std=c++20', 'b_ndebug=if-release']
)
wren_dep = dependency('wren', version: '>=0.2.0',
fallback: ['wren', 'wren_dep'],
default_options: [
'default_library=static',
'build_testing=false',
'wren_with_rand=' + get_option('wren_with_rand').to_string(),
'wren_with_meta=' + get_option('wren_with_meta').to_string(),
],
static: true,
)
public_incl = [include_directories('include')]
os = host_machine.system()
if os == 'gnu'
os = 'hurd'
elif os == 'linux'
os = 'gnu'
endif
arch = host_machine.cpu_family()
if arch == 'x86_64'
arch = 'amd64'
endif
ptr_size = 0
func_ptr_size = 0
conf = configuration_data()
if os == 'gnu' and arch == 'amd64'
ptr_size = 8
func_ptr_size = 8
elif os == 'gnu' and arch == 'aarch64'
ptr_size = 8
func_ptr_size = 8
endif
conf.set('POINTER_SIZE', ptr_size)
conf.set('FUNC_POINTER_SIZE', func_ptr_size)
conf.set('WRENPP_NAME', meson.project_name())
project_config_file = configure_file(
input: 'src/pvt_config.h.in',
output: 'pvt_config.h',
configuration: conf
)
subdir('include')
wrenpp = library(meson.project_name(),
project_config_file,
'src/vm.cpp',
'src/configuration.cpp',
'src/def_configuration.cpp',
'src/dynafunc_maker.cpp',
'src/dynafunc_' + arch + '_' + os + '.S',
'src/handle.cpp',
'src/vm_fun.cpp',
dependencies: [wren_dep],
include_directories: public_incl,
install: true,
)
wrenpp_dep = declare_dependency(
link_with: wrenpp,
include_directories: public_incl,
)
if get_option('build_examples')
subdir('examples')
endif
if get_option('build_testing')
subdir('test')
endif