Debian Codegraph @

test cases/cmake/24 mixing languages/meson.build

raw
1 # Explicitly require PIE so that mixing compilers with different defaults for
2 # whether to use PIE works.
3 project('CMake mix', ['c', 'cpp'],
4 default_options: ['b_pie=true'])
5
6 if not add_languages('objc', required : false)
7 error('MESON_SKIP_TEST: No ObjC compiler')
8 endif
9
10 objc = meson.get_compiler('objc')
11 c = meson.get_compiler('c')
12 if c.get_argument_syntax() != objc.get_argument_syntax()
13 error('MESON_SKIP_TEST: cmake cannot mix compiler types on Windows')
14 endif
15
16 cm = import('cmake')
17
18 sub_pro = cm.subproject('cmTest')
19 sub_dep = sub_pro.dependency('cmTest', include_type: 'system')
20
21 exe1 = executable('exe1', ['main.c'], dependencies: [sub_dep])
22 test('test1', exe1)