2020-04-30 22:14:55 +00:00
|
|
|
project('wrenpp', 'cpp',
|
|
|
|
version: '0.1.0',
|
2020-04-24 23:49:46 +00:00
|
|
|
meson_version: '>=0.49.2',
|
2020-04-30 22:49:52 +00:00
|
|
|
default_options: ['buildtype=release', 'cpp_std=c++17', 'b_ndebug=if-release'],
|
2020-04-24 23:49:46 +00:00
|
|
|
)
|
|
|
|
|
2020-04-30 22:14:55 +00:00
|
|
|
wren_dep = dependency('wren', version: '>=0.2.0',
|
|
|
|
fallback: ['wren', 'wren_dep'],
|
|
|
|
default_options: [
|
|
|
|
'default_library=static',
|
|
|
|
'build_testing=false',
|
|
|
|
'wren_with_cli=false',
|
|
|
|
],
|
|
|
|
static: true,
|
|
|
|
)
|
2020-04-30 20:50:46 +00:00
|
|
|
public_incl = include_directories('include')
|
2020-04-24 23:49:46 +00:00
|
|
|
|
2020-04-26 20:06:53 +00:00
|
|
|
os = host_machine.system()
|
|
|
|
if os == 'gnu'
|
|
|
|
os = 'hurd'
|
|
|
|
elif os == 'linux'
|
|
|
|
os = 'gnu'
|
|
|
|
endif
|
|
|
|
|
2020-04-27 10:05:03 +00:00
|
|
|
arch = host_machine.cpu_family()
|
2020-04-26 20:06:53 +00:00
|
|
|
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
|
|
|
|
endif
|
|
|
|
|
|
|
|
conf.set('POINTER_SIZE', ptr_size)
|
|
|
|
conf.set('FUNC_POINTER_SIZE', func_ptr_size)
|
|
|
|
|
|
|
|
project_config_file = configure_file(
|
|
|
|
input: 'src/config.h.in',
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: conf
|
|
|
|
)
|
|
|
|
|
2020-04-30 20:50:46 +00:00
|
|
|
wrenpp = library(meson.project_name(),
|
2020-04-26 20:06:53 +00:00
|
|
|
project_config_file,
|
2020-04-25 18:45:59 +00:00
|
|
|
'src/wren/vm.cpp',
|
|
|
|
'src/wren/configuration.cpp',
|
|
|
|
'src/wren/def_configuration.cpp',
|
2020-04-26 15:19:02 +00:00
|
|
|
'src/wren/dynafunc_maker.cpp',
|
2020-04-30 20:57:52 +00:00
|
|
|
'src/wren/dynafunc_' + arch + '_' + os + '.S',
|
2020-04-28 12:25:35 +00:00
|
|
|
'src/wren/handle.cpp',
|
2020-04-30 16:32:41 +00:00
|
|
|
'src/wren/vm_fun.cpp',
|
2020-04-24 23:49:46 +00:00
|
|
|
dependencies: [wren_dep],
|
2020-04-30 20:50:46 +00:00
|
|
|
include_directories: public_incl,
|
2020-04-24 23:49:46 +00:00
|
|
|
install: true,
|
|
|
|
)
|
2020-04-30 20:50:46 +00:00
|
|
|
wrenpp_dep = declare_dependency(
|
|
|
|
link_with: wrenpp,
|
|
|
|
include_directories: public_incl,
|
|
|
|
)
|
|
|
|
|
|
|
|
executable(meson.project_name(),
|
|
|
|
'src/main.cpp',
|
|
|
|
dependencies: wrenpp_dep,
|
|
|
|
install: false,
|
|
|
|
)
|