diff options
| author | ruki <[email protected]> | 2025-12-07 12:33:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-07 17:15:59 +0800 |
| commit | 58045d685b6daea07dbc641e84eaaa8527c6a189 (patch) | |
| tree | 0a8bf201e3d3f679039c22aa9e2d6f67c757928b /xmake | |
| parent | bbfd1bd9a4ae413354f37f46935097cf591b6c6c (diff) | |
improve bin2c demo
Diffstat (limited to 'xmake')
| -rw-r--r-- | xmake/rules/utils/bin2c/xmake.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/rules/utils/bin2c/xmake.lua b/xmake/rules/utils/bin2c/xmake.lua index 082e8fb5b..fc05ecf4e 100644 --- a/xmake/rules/utils/bin2c/xmake.lua +++ b/xmake/rules/utils/bin2c/xmake.lua @@ -44,7 +44,13 @@ rule("utils.bin2c") table.insert(argv, "-w") table.insert(argv, tostring(linewidth)) end - local nozeroend = target:extraconf("rules", "utils.bin2c", "nozeroend") + -- get nozeroend (check file-level config first, then rule-level config) + local fileconfig = target:fileconfig(sourcefile_bin) + local nozeroend = (fileconfig and fileconfig.nozeroend) or target:extraconf("rules", "utils.bin2c", "nozeroend") or false + -- also support zeroend (inverse of nozeroend) + if fileconfig and fileconfig.zeroend ~= nil then + nozeroend = not fileconfig.zeroend + end if nozeroend then table.insert(argv, "--nozeroend") end |
