From dae986073d5ab3a6241cecaf3362065256400772 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 23 May 2022 16:21:39 +0200 Subject: take override_option('unity=...') into account when allowing extract_objects() A single target could be picked for unity build, and in that case extract_objects() should not be allowed. Likewise for the opposite case, where extract_objects() should be allowed if unity build is disabled for a single target. A test that covers that case is added later. --- test cases/failing/126 extract from unity/meson.build | 4 ++++ test cases/failing/126 extract from unity/src1.c | 3 +++ test cases/failing/126 extract from unity/src2.c | 3 +++ test cases/failing/126 extract from unity/test.json | 7 +++++++ 4 files changed, 17 insertions(+) create mode 100644 test cases/failing/126 extract from unity/meson.build create mode 100644 test cases/failing/126 extract from unity/src1.c create mode 100644 test cases/failing/126 extract from unity/src2.c create mode 100644 test cases/failing/126 extract from unity/test.json (limited to 'test cases') diff --git a/test cases/failing/126 extract from unity/meson.build b/test cases/failing/126 extract from unity/meson.build new file mode 100644 index 0000000..9e3e65f --- /dev/null +++ b/test cases/failing/126 extract from unity/meson.build @@ -0,0 +1,4 @@ +project('extract nonexisting gen', 'c') + +lib1 = library('lib1', 'src1.c', 'src2.c', override_options: ['unity=on']) +lib2 = library('lib2', objects: lib1.extract_objects('src1.c')) diff --git a/test cases/failing/126 extract from unity/src1.c b/test cases/failing/126 extract from unity/src1.c new file mode 100644 index 0000000..da971bb --- /dev/null +++ b/test cases/failing/126 extract from unity/src1.c @@ -0,0 +1,3 @@ +int sub_lib_method1() { + return 1337; +} diff --git a/test cases/failing/126 extract from unity/src2.c b/test cases/failing/126 extract from unity/src2.c new file mode 100644 index 0000000..a461669 --- /dev/null +++ b/test cases/failing/126 extract from unity/src2.c @@ -0,0 +1,3 @@ +int sub_lib_method2() { + return 1337; +} diff --git a/test cases/failing/126 extract from unity/test.json b/test cases/failing/126 extract from unity/test.json new file mode 100644 index 0000000..9f3a8d8 --- /dev/null +++ b/test cases/failing/126 extract from unity/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "test cases/failing/126 extract from unity/meson.build:4:0: ERROR: Single object files can not be extracted in Unity builds. You can only extract all the object files for each compiler at once." + } + ] +} -- cgit v1.1