- Name property would be used even under c3c test #2587.

This commit is contained in:
Christoffer Lerno
2025-11-22 18:02:00 +01:00
parent 60cdea5292
commit 98155b61f1
5 changed files with 7 additions and 1 deletions

View File

@@ -80,6 +80,7 @@
- Compiler segfault when getting a nonexistant member from an unnamed struct #2533.
- Correctly mention aliased type when method is not implemented #2534.
- Regression: Not printing backtrace when tests fail for MacOS #2536.
- Name property would be used even under `c3c test` #2587.
### Stdlib changes
- Sorting functions correctly took slices by value, but also other types by value. Now, only slices are accepted by value, other containers are always by ref.

View File

@@ -514,6 +514,7 @@ typedef struct BuildOptions_
const char **feature_names;
const char **removed_feature_names;
const char *output_name;
const char *runner_output_name;
const char *project_name;
const char *target_select;
const char *path;
@@ -673,6 +674,7 @@ typedef struct
Library **library_list;
LibraryTarget **ccompiling_libraries;
const char *name;
const char *runner_output_name;
const char *output_name;
const char *extension;
const char *version;

View File

@@ -599,7 +599,7 @@ static void parse_option(BuildOptions *options)
if (match_shortopt("o"))
{
if (at_end()) error_exit("error: -o needs a name.");
options->output_name = next_arg();
options->runner_output_name = options->output_name = next_arg();
return;
}
break;

View File

@@ -644,6 +644,7 @@ void init_default_build_target(BuildTarget *target, BuildOptions *options)
target->source_dirs = NULL;
target->name = options->output_name;
target->output_name = options->output_name;
target->runner_output_name = options->runner_output_name;
update_build_target_from_options(target, options);
}

View File

@@ -565,10 +565,12 @@ void compiler_compile(void)
{
case TARGET_TYPE_BENCHMARK:
compiler.build.name = "benchmarkrun";
compiler.build.output_name = compiler.build.runner_output_name ? compiler.build.runner_output_name : compiler.build.name;
output_exe = exe_name();
break;
case TARGET_TYPE_TEST:
compiler.build.name = "testrun";
compiler.build.output_name = compiler.build.runner_output_name ? compiler.build.runner_output_name : compiler.build.name;
output_exe = exe_name();
break;
case TARGET_TYPE_EXECUTABLE: