mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix regression in file output placement.
This commit is contained in:
@@ -310,7 +310,7 @@ void codegen_setup_object_names(Module *module, const char **base_name, const ch
|
||||
{
|
||||
res = str_printf("%s%s", result, ext);
|
||||
}
|
||||
compiler.obj_output = *object_filename = file_append_path(compiler.build.output_dir ? compiler.build.output_dir : ".", res);
|
||||
compiler.obj_output = *object_filename = (file_path_is_relative(res) ? file_append_path(compiler.build.output_dir, res) : res);
|
||||
char *dir_path = NULL;
|
||||
char *filename = NULL;
|
||||
file_get_dir_and_filename_from_full(compiler.obj_output, &filename, &dir_path);
|
||||
|
||||
@@ -695,11 +695,11 @@ void compiler_compile(void)
|
||||
if (vec_size(compiler.build.emit_only)) goto SKIP;
|
||||
if (output_exe)
|
||||
{
|
||||
if (compiler.build.output_dir)
|
||||
if (file_path_is_relative(output_exe))
|
||||
{
|
||||
create_output_dir(compiler.build.output_dir);
|
||||
output_exe = file_append_path(compiler.build.output_dir, output_exe);
|
||||
}
|
||||
;
|
||||
file_create_folders(output_exe);
|
||||
bool system_linker_available = link_libc() && compiler.platform.os != OS_TYPE_WIN32;
|
||||
bool use_system_linker = system_linker_available && compiler.build.arch_os_target == default_target;
|
||||
@@ -795,9 +795,8 @@ void compiler_compile(void)
|
||||
}
|
||||
else if (output_static)
|
||||
{
|
||||
if (compiler.build.output_dir)
|
||||
if (file_path_is_relative(output_static))
|
||||
{
|
||||
create_output_dir(compiler.build.output_dir);
|
||||
output_static = file_append_path(compiler.build.output_dir, output_static);
|
||||
}
|
||||
file_create_folders(output_static);
|
||||
@@ -812,9 +811,8 @@ void compiler_compile(void)
|
||||
}
|
||||
else if (output_dynamic)
|
||||
{
|
||||
if (compiler.build.output_dir)
|
||||
if (file_path_is_relative(output_dynamic))
|
||||
{
|
||||
create_output_dir(compiler.build.output_dir);
|
||||
output_dynamic = file_append_path(compiler.build.output_dir, output_dynamic);
|
||||
}
|
||||
file_create_folders(output_dynamic);
|
||||
|
||||
Reference in New Issue
Block a user