Skip to content

Commit

Permalink
Make Windows link step use the command-line --linker value if present.
Browse files Browse the repository at this point in the history
  • Loading branch information
chalcolith authored and SeanTAllen committed Sep 16, 2017
1 parent 021e3d4 commit 26b7c8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libponyc/codegen/genexe.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ static bool link_exe(compile_t* c, ast_t* program,
strlen(vcvars.kernel32) + strlen(vcvars.msvcrt) + strlen(lib_args);
char* ld_cmd = (char*)ponyint_pool_alloc_size(ld_len);

char* linker = vcvars.link;
if (c->opt->linker != NULL && strlen(c->opt->linker) > 0)
linker = c->opt->linker;

while (true)
{
size_t num_written = snprintf(ld_cmd, ld_len,
Expand All @@ -339,7 +343,7 @@ static bool link_exe(compile_t* c, ast_t* program,
"/LIBPATH:\"%s\" "
"/LIBPATH:\"%s\" "
"%s %s %s \"",
vcvars.link, file_exe, file_o, ucrt_lib, vcvars.kernel32,
linker, file_exe, file_o, ucrt_lib, vcvars.kernel32,
vcvars.msvcrt, lib_args, vcvars.default_libs, ponyrt
);

Expand Down

0 comments on commit 26b7c8a

Please sign in to comment.