Skip to content

Commit 14d36c1

Browse files
authored
Merge 3428692 into 9c1b6a9
2 parents 9c1b6a9 + 3428692 commit 14d36c1

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

docs/yaml/functions/_build_target_base.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ kwargs:
191191
(but *not* before that). On Windows, this argument has no effect.
192192
193193
objects:
194-
type: list[extracted_obj]
194+
type: list[extracted_obj | file | str]
195195
description: |
196-
List of prebuilt object files (usually for third party
197-
products you don't have source to) that should be linked in this
198-
target, **never** use this for object files that you build yourself.
196+
List of object files that should be linked in this target.
197+
These can include third party products you don't have source to,
198+
or object files produced by other build targets.
199199
200200
name_prefix:
201201
type: str | list[void]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /usr/bin/env python3
2+
3+
import sys
4+
from shutil import copyfile
5+
copyfile(*sys.argv[1:])

test cases/unit/15 prebuilt object/meson.build

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,22 @@ endif
1919
# declaration. run_tests.py generates the
2020
# prebuilt object before running this test.
2121

22-
e = executable('prog', 'main.c',
23-
objects : prebuilt)
22+
e = []
2423

25-
test('objtest', e)
24+
e += executable('exe1', sources: 'main.c', objects: prebuilt)
25+
e += executable('exe2', sources: 'main.c', objects: files(prebuilt))
26+
27+
sl1 = static_library('lib3', objects: prebuilt)
28+
e += executable('exe3', sources: 'main.c', objects: sl1.extract_all_objects(recursive: true))
29+
30+
ct = custom_target(output: 'copy-' + prebuilt, input: prebuilt,
31+
command: [find_program('cp.py'), '@INPUT@', '@OUTPUT@'])
32+
e += executable('exe4', 'main.c', ct)
33+
e += executable('exe5', 'main.c', ct[0])
34+
35+
sl2 = static_library('lib6', sources: ct)
36+
e += executable('exe6', sources: 'main.c', objects: sl2.extract_all_objects(recursive: true))
37+
38+
foreach i : e
39+
test(i.name(), i)
40+
endforeach

0 commit comments

Comments
 (0)