diff options
| author | ruki <[email protected]> | 2026-07-18 00:07:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-07-18 00:07:38 +0800 |
| commit | f9093aadcf44cadc7b3ab3c155de017d21bc5e47 (patch) | |
| tree | 90ca7b8d8d352281d78e2bcca6973c6215a43eeb | |
| parent | 1dee1ac4425bc1792bf79bffd329f92080580cc8 (diff) | |
fix bin2obj symbols
| -rw-r--r-- | xmake/rules/utils/bin2c/utils.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/utils/bin2obj/utils.lua | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/xmake/rules/utils/bin2c/utils.lua b/xmake/rules/utils/bin2c/utils.lua index b5bf7638b..8ea6ba17a 100644 --- a/xmake/rules/utils/bin2c/utils.lua +++ b/xmake/rules/utils/bin2c/utils.lua @@ -58,7 +58,7 @@ function generate_headerfile(target, batchcmds, binaryfile, opt) local transform = opt.transform or (fileconfig and fileconfig.transform) or target:extraconf("rules", rulename, "transform") if transform then batchcmds:show_progress(progress, "${color.build.object}transforming.bin2obj %s", binaryfile) - local transformed_file = target:autogenfile(binaryfile .. ".transformed") + local transformed_file = target:autogenfile(binaryfile) batchcmds:call(transform, {binaryfile, transformed_file}, {target = target}) binaryfile = transformed_file end diff --git a/xmake/rules/utils/bin2obj/utils.lua b/xmake/rules/utils/bin2obj/utils.lua index c7da5f1a1..7b98660d3 100644 --- a/xmake/rules/utils/bin2obj/utils.lua +++ b/xmake/rules/utils/bin2obj/utils.lua @@ -54,6 +54,16 @@ function generate_objectfile(target, batchcmds, binaryfile, opt) end end + -- transform binary data first + -- @see https://github.com/xmake-io/xmake/issues/7513 + local transform = opt.transform or (fileconfig and fileconfig.transform) or target:extraconf("rules", rulename, "transform") + if transform then + batchcmds:show_progress(progress, "${color.build.object}transforming.bin2obj %s", binaryfile) + local transformed_file = target:autogenfile(binaryfile) + batchcmds:call(transform, {binaryfile, transformed_file}, {target = target}) + binaryfile = transformed_file + end + -- get object file local objectfile = opt.objectfile if not objectfile then @@ -64,16 +74,6 @@ function generate_objectfile(target, batchcmds, binaryfile, opt) end table.insert(target:objectfiles(), objectfile) - -- transform binary data first - -- @see https://github.com/xmake-io/xmake/issues/7513 - local transform = opt.transform or (fileconfig and fileconfig.transform) or target:extraconf("rules", rulename, "transform") - if transform then - batchcmds:show_progress(progress, "${color.build.object}transforming.bin2obj %s", binaryfile) - local transformed_file = target:autogenfile(binaryfile .. ".transformed") - batchcmds:call(transform, {binaryfile, transformed_file}, {target = target}) - binaryfile = transformed_file - end - -- add commands if progress then batchcmds:show_progress(progress, "${color.build.object}generating.bin2obj %s", binaryfile) |
