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)
|
2019-04-02 17:12:10 +08:00
|
|
|
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
|
|
|
|
|
2019-04-13 15:20:47 +08:00
|
|
|
set_variable('list_test_plusassign', [])
|
|
|
|
list_test_plusassign += ['bugs everywhere']
|
|
|
|
|
2019-02-19 00:07:11 +08:00
|
|
|
if false
|
|
|
|
dependency('somethingthatdoesnotexist', required: true)
|
|
|
|
dependency('look_i_have_a_fallback', fallback: ['oh_no', 'the_subproject_does_not_exist'])
|
|
|
|
endif
|
2018-11-29 19:56:52 +08:00
|
|
|
|
|
|
|
subdir('sharedlib')
|
|
|
|
subdir('staticlib')
|
|
|
|
|
2019-04-21 03:25:52 +08:00
|
|
|
var1 = '1'
|
|
|
|
var2 = '2'
|
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)), 't2.cpp', link_with: [staticlib])
|
2018-11-29 19:56:52 +08:00
|
|
|
t2 = executable('test2', '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
|
|
|
|
|
|
|
test('test case 1', t1)
|
|
|
|
test('test case 2', t2)
|
|
|
|
benchmark('benchmark 1', t3)
|