meson/test cases/unit/57 introspection/meson.build

49 lines
1.8 KiB
Meson
Raw Normal View History

2018-11-29 21:21:07 +08:00
project('introspection', ['c', 'cpp'], version: '1.2.3', default_options: ['cpp_std=c++11', 'buildtype=debug'])
2018-11-29 19:56:52 +08:00
2018-11-29 23:19:01 +08:00
dep1 = dependency('threads')
2019-02-19 00:07:11 +08:00
dep2 = dependency('zlib', required: false)
dep3 = dependency('bugDep1', required: get_option('test_opt1'))
2019-02-19 00:07:11 +08:00
2019-04-02 17:39:45 +08:00
b1 = get_option('test_opt1')
b2 = get_option('test_opt2')
test_bool = b1 or b2
test_bool = b1 and b2
test_bool = not test_bool
2019-04-02 17:39:45 +08:00
set_variable('list_test_plusassign', [])
list_test_plusassign += ['bugs everywhere']
2019-02-19 00:07:11 +08:00
if false
vers_str = '<=99.9.9'
dependency('somethingthatdoesnotexist', required: true, version: '>=1.2.3')
dependency('look_i_have_a_fallback', version: ['>=1.0.0', vers_str], fallback: ['oh_no', 'the_subproject_does_not_exist'])
2019-02-19 00:07:11 +08:00
endif
2018-11-29 19:56:52 +08:00
subdir('sharedlib')
subdir('staticlib')
2019-04-21 03:25:52 +08:00
var1 = '1'
2019-04-21 05:02:03 +08:00
var2 = 2.to_string()
2019-04-21 02:38:59 +08:00
var3 = 'test3'
2019-04-21 03:25:52 +08:00
t1 = executable('test' + var1, ['t1.cpp'], link_with: [sharedlib], install: true, build_by_default: get_option('test_opt2'))
t2 = executable('test@0@'.format('@0@'.format(var2)), sources: ['t2.cpp'], link_with: [staticlib])
2019-04-21 02:38:59 +08:00
t3 = executable(var3, 't3.cpp', link_with: [sharedlib, staticlib], dependencies: [dep1])
2018-11-29 19:56:52 +08:00
2019-04-23 02:46:25 +08:00
### BEGIN: Test inspired by taisei: https://github.com/taisei-project/taisei/blob/master/meson.build#L293
systype = '@0@'.format(host_machine.system())
systype = '@0@, @1@, @2@'.format(systype, host_machine.cpu_family(), host_machine.cpu())
2019-04-23 02:46:25 +08:00
message(systype)
### END: Test inspired by taisei
2019-05-13 01:37:40 +08:00
# 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
2018-11-29 19:56:52 +08:00
test('test case 1', t1)
test('test case 2', t2)
benchmark('benchmark 1', t3)