The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.7 KiB
47 lines
1.7 KiB
6 years ago
|
project('introspection', ['c', 'cpp'], version: '1.2.3', default_options: ['cpp_std=c++11', 'buildtype=debug'])
|
||
6 years ago
|
|
||
6 years ago
|
dep1 = dependency('threads')
|
||
6 years ago
|
dep2 = dependency('zlib', required: false)
|
||
6 years ago
|
dep3 = dependency('bugDep1', required: get_option('test_opt1'))
|
||
6 years ago
|
|
||
6 years ago
|
b1 = get_option('test_opt1')
|
||
|
b2 = get_option('test_opt2')
|
||
|
test_bool = b1 or b2
|
||
|
test_bool = b1 and b2
|
||
|
|
||
6 years ago
|
set_variable('list_test_plusassign', [])
|
||
|
list_test_plusassign += ['bugs everywhere']
|
||
|
|
||
6 years ago
|
if false
|
||
|
dependency('somethingthatdoesnotexist', required: true)
|
||
|
dependency('look_i_have_a_fallback', fallback: ['oh_no', 'the_subproject_does_not_exist'])
|
||
|
endif
|
||
6 years ago
|
|
||
|
subdir('sharedlib')
|
||
|
subdir('staticlib')
|
||
|
|
||
6 years ago
|
var1 = '1'
|
||
6 years ago
|
var2 = 2.to_string()
|
||
6 years ago
|
var3 = 'test3'
|
||
|
|
||
6 years ago
|
t1 = executable('test' + var1, ['t1.cpp'], link_with: [sharedlib], install: true, build_by_default: get_option('test_opt2'))
|
||
5 years ago
|
t2 = executable('test@0@'.format('@0@'.format(var2)), sources: ['t2.cpp'], link_with: [staticlib])
|
||
6 years ago
|
t3 = executable(var3, 't3.cpp', link_with: [sharedlib, staticlib], dependencies: [dep1])
|
||
6 years ago
|
|
||
6 years ago
|
### BEGIN: Test inspired by taisei: https://github.com/taisei-project/taisei/blob/master/meson.build#L293
|
||
|
systype = '@0@'.format(host_machine.system())
|
||
6 years ago
|
systype = '@0@, @1@, @2@'.format(systype, host_machine.cpu_family(), host_machine.cpu())
|
||
6 years ago
|
message(systype)
|
||
|
### END: Test inspired by taisei
|
||
6 years ago
|
|
||
6 years ago
|
# Minimal code version to produce bug #5376
|
||
|
# Code inspired by https://github.com/mesa3d/mesa/blob/974c4d679c23373dbed386c696e3e3bc1bfa23ae/meson.build#L1341-L1347
|
||
|
osmesa_lib_name = 'OSMesa'
|
||
|
osmesa_bits = '8'
|
||
|
osmesa_lib_name = osmesa_lib_name + osmesa_bits
|
||
|
message(osmesa_lib_name) # Infinite recursion gets triggered here when the parameter osmesa_lib_name is resolved
|
||
|
|
||
6 years ago
|
test('test case 1', t1)
|
||
|
test('test case 2', t2)
|
||
|
benchmark('benchmark 1', t3)
|