From 8ec6401ce8fbc9f82d9795571e14e3342728f5c2 Mon Sep 17 00:00:00 2001 From: MAJigsaw77 <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 5 Nov 2025 22:47:48 +0200 Subject: [PATCH 1/4] Fix `ranlib` when `libdir` is set. --- tools/hxcpp/Linker.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hxcpp/Linker.hx b/tools/hxcpp/Linker.hx index d65281d8f..1fdddb8a2 100644 --- a/tools/hxcpp/Linker.hx +++ b/tools/hxcpp/Linker.hx @@ -301,7 +301,7 @@ class Linker if (mRanLib!="") { - args = [out_name]; + args = [out+mLibDir!=""?mLibDir + "/" + file_name:out_name]; var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + out_name); if (result!=0) { From d87ca725354745acdfc22b3df7aec42bbf0808f2 Mon Sep 17 00:00:00 2001 From: MAJigsaw77 <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:12:13 +0200 Subject: [PATCH 2/4] Dont add the `out`. --- tools/hxcpp/Linker.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hxcpp/Linker.hx b/tools/hxcpp/Linker.hx index 1fdddb8a2..7a4473c38 100644 --- a/tools/hxcpp/Linker.hx +++ b/tools/hxcpp/Linker.hx @@ -301,7 +301,7 @@ class Linker if (mRanLib!="") { - args = [out+mLibDir!=""?mLibDir + "/" + file_name:out_name]; + args = [mLibDir!=""?mLibDir+"/"+file_name:out_name]; var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + out_name); if (result!=0) { From 3567d9bc4e36d0b15743570b718c1a8e4753da8c Mon Sep 17 00:00:00 2001 From: MAJigsaw77 <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:52:37 +0200 Subject: [PATCH 3/4] Consistent lib name + add a log when the file is moved. --- tools/hxcpp/Linker.hx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/hxcpp/Linker.hx b/tools/hxcpp/Linker.hx index 7a4473c38..2d911a28f 100644 --- a/tools/hxcpp/Linker.hx +++ b/tools/hxcpp/Linker.hx @@ -291,8 +291,9 @@ class Linker args = args.concat(libs); + var lib_name = mLibDir!="" ? mLibDir+"/"+file_name : out_name; var result = ProcessManager.runCommand("", mExe, args, true, true, false, - "\x1b[1mLink: \x1b[0m" + out_name); + "\x1b[1mLink: \x1b[0m" + lib_name); if (result!=0) { Tools.exit(result); @@ -301,8 +302,8 @@ class Linker if (mRanLib!="") { - args = [mLibDir!=""?mLibDir+"/"+file_name:out_name]; - var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + out_name); + args = [lib_name]; + var result = ProcessManager.runCommand("", mRanLib, args, true, true, false, "\x1b[1mRanlib:\x1b[0m " + lib_name); if (result!=0) { Tools.exit(result); @@ -314,6 +315,7 @@ class Linker { sys.io.File.copy( mLibDir+"/"+file_name, out_name ); FileSystem.deleteFile( mLibDir+"/"+file_name ); + Log.info("\x1b[1mMove file: \x1b[0m" + mLibDir+"/"+file_name + " to " + out_name); } sys.io.File.saveContent(hashFile,md5); From bb8c9c2419c1ee3074f09b5aa412d61d40a4e2fb Mon Sep 17 00:00:00 2001 From: MAJigsaw77 <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:59:15 +0200 Subject: [PATCH 4/4] Put the log before moving. --- tools/hxcpp/Linker.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hxcpp/Linker.hx b/tools/hxcpp/Linker.hx index 2d911a28f..645980288 100644 --- a/tools/hxcpp/Linker.hx +++ b/tools/hxcpp/Linker.hx @@ -313,9 +313,9 @@ class Linker if (mLibDir!="") { + Log.info("\x1b[1mMove file: \x1b[0m" + mLibDir+"/"+file_name + " to " + out_name); sys.io.File.copy( mLibDir+"/"+file_name, out_name ); FileSystem.deleteFile( mLibDir+"/"+file_name ); - Log.info("\x1b[1mMove file: \x1b[0m" + mLibDir+"/"+file_name + " to " + out_name); } sys.io.File.saveContent(hashFile,md5);