Skip to content

Commit beaa519

Browse files
authored
Fix ranlib when libdir is set. (#1267)
* Fix `ranlib` when `libdir` is set. * Dont add the `out`. * Consistent lib name + add a log when the file is moved. * Put the log before moving.
1 parent daffb7b commit beaa519

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/hxcpp/Linker.hx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ class Linker
291291

292292
args = args.concat(libs);
293293

294+
var lib_name = mLibDir!="" ? mLibDir+"/"+file_name : out_name;
294295
var result = ProcessManager.runCommand("", mExe, args, true, true, false,
295-
"\x1b[1mLink: \x1b[0m" + out_name);
296+
"\x1b[1mLink: \x1b[0m" + lib_name);
296297
if (result!=0)
297298
{
298299
Tools.exit(result);
@@ -301,8 +302,8 @@ class Linker
301302

302303
if (mRanLib!="")
303304
{
304-
args = [out_name];
305-
var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + out_name);
305+
args = [lib_name];
306+
var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + lib_name);
306307
if (result!=0)
307308
{
308309
Tools.exit(result);
@@ -312,6 +313,7 @@ class Linker
312313

313314
if (mLibDir!="")
314315
{
316+
Log.info("\x1b[1mMove file: \x1b[0m" + mLibDir+"/"+file_name + " to " + out_name);
315317
sys.io.File.copy( mLibDir+"/"+file_name, out_name );
316318
FileSystem.deleteFile( mLibDir+"/"+file_name );
317319
}

0 commit comments

Comments
 (0)