King_DuckZ
640cc0e493
I currently have meson 0.52.1 and the default_library=static option has no effect for me, but I'm leaving it there in case this changes in the future.
71 lines
1.5 KiB
Meson
71 lines
1.5 KiB
Meson
project('wrenpp', 'cpp',
|
|
version: '0.1.0',
|
|
meson_version: '>=0.49.2',
|
|
default_options: ['debug=true', 'cpp_std=c++17', '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_cli=false',
|
|
'wren_installable=false',
|
|
],
|
|
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
|
|
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
|
|
)
|
|
|
|
wrenpp = library(meson.project_name(),
|
|
project_config_file,
|
|
'src/wren/vm.cpp',
|
|
'src/wren/configuration.cpp',
|
|
'src/wren/def_configuration.cpp',
|
|
'src/wren/dynafunc_maker.cpp',
|
|
'src/wren/dynafunc_' + arch + '_' + os + '.S',
|
|
'src/wren/handle.cpp',
|
|
'src/wren/vm_fun.cpp',
|
|
dependencies: [wren_dep],
|
|
include_directories: public_incl,
|
|
install: true,
|
|
)
|
|
wrenpp_dep = declare_dependency(
|
|
link_with: wrenpp,
|
|
include_directories: public_incl,
|
|
)
|
|
|
|
executable(meson.project_name(),
|
|
'src/main.cpp',
|
|
dependencies: wrenpp_dep,
|
|
install: false,
|
|
)
|