Debian Codegraph @

vendored-meson/meson/test cases/common/102 extract same name/meson.build

raw
1 project('object extraction', 'c')
2
3 if meson.backend() == 'xcode'
4 # Xcode gives object files unique names but only if they would clash. For example
5 # two files named lib.o instead get the following names:
6 #
7 # lib-4fbe522d8ba4cb1f1b89cc2df640a2336b92e1a5565f0a4c5a79b5b5e2969eb9.o
8 # lib-4fbe522d8ba4cb1f1b89cc2df640a2336deeff2bc2297affaadbe20f5cbfee56.o
9 #
10 # No-one has reverse engineered the naming scheme so we would access them.
11 # IF you feel up to the challenge, patches welcome.
12 error('MESON_SKIP_TEST, Xcode cannot extract objs when they would have the same filename.')
13 endif
14
15 lib = library('somelib', ['lib.c', 'src/lib.c'])
16 # Also tests that the object list is flattened properly
17 obj = lib.extract_objects(['lib.c', ['src/lib.c']])
18 exe = executable('main', 'main.c', objects: obj)
19 test('extraction', exe)