From d2988e6a88fa4d62801a5ba2e2f484485ebcb982 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Wed, 7 Aug 2024 01:35:04 +0200 Subject: [PATCH] With single module, name the .o file after what `-o` provides. #1306 --- releasenotes.md | 1 + src/compiler/module.c | 1 + 2 files changed, 2 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index bdd191d46..6b1688519 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -49,6 +49,7 @@ - Fixes to the socket functions. - Improved output when pointer is out of range. - Better error when casting to a distinct fails. +- With single module, name the .o file after what `-o` provides. #1306 ### Stdlib changes diff --git a/src/compiler/module.c b/src/compiler/module.c index c22253329..290e37365 100644 --- a/src/compiler/module.c +++ b/src/compiler/module.c @@ -43,6 +43,7 @@ void scratch_buffer_append_module(Module *module, bool is_export) const char *module_create_object_file_name(Module *module) { + if (active_target.single_module == SINGLE_MODULE_ON && active_target.name) return active_target.name; scratch_buffer_clear(); char c; const char *name = module->name->module;