diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 374b7fb7a..7dc1b8353 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -443,7 +443,13 @@ class Backend: sources.append(File(True, dirpart, fnamepart)) # Filter out headers and all non-source files - sources = [s for s in sources if self.environment.is_source(s) and not self.environment.is_header(s)] + filtered_sources = [] + for s in sources: + if self.environment.is_source(s) and not self.environment.is_header(s): + filtered_sources.append(s) + elif self.environment.is_object(s): + result.append(s.relative_name()) + sources = filtered_sources # extobj could contain only objects and no sources if not sources: diff --git a/test cases/nasm/1 configure file/meson.build b/test cases/nasm/1 configure file/meson.build index e1283252f..85ecaf1c4 100644 --- a/test cases/nasm/1 configure file/meson.build +++ b/test cases/nasm/1 configure file/meson.build @@ -47,3 +47,9 @@ exe = executable('hello', asm_gen.process('hello.asm'), ) test('test-nasm-configure-file', exe) + +exe2 = executable('hello2', objects : exe.extract_all_objects(), + link_args: link_args, +) + +test('test-nasm-extract-all-objects', exe2)