diff options
| author | ruki <[email protected]> | 2025-12-09 22:34:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-09 22:34:36 +0800 |
| commit | 5931e48282914758fd7c4eeaf9ca05a16521692b (patch) | |
| tree | f06ffda22f2675a3e08979503b4bff1de0e08e0f /xmake/modules/utils/binary | |
| parent | 102507b96dab0403592c07c8760644f08ed66dff (diff) | |
fix compile error
Diffstat (limited to 'xmake/modules/utils/binary')
| -rw-r--r-- | xmake/modules/utils/binary/bin2obj.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xmake/modules/utils/binary/bin2obj.lua b/xmake/modules/utils/binary/bin2obj.lua index 7870e2544..95e705ca6 100644 --- a/xmake/modules/utils/binary/bin2obj.lua +++ b/xmake/modules/utils/binary/bin2obj.lua @@ -47,17 +47,17 @@ function _do_bin2obj(binarypath, outputpath, opt) local basename = filename:gsub("%.", "_") opt.basename = basename - -- get format (default: coff) - local format = opt.format or "coff" - format = format:lower() - -- validate format - if format ~= "coff" and format ~= "elf" and format ~= "macho" then - raise("bin2obj: unsupported format '%s' (supported: coff, elf, macho)", format) + local format = opt.format + if format then + format = format:lower() + if format ~= "coff" and format ~= "elf" and format ~= "macho" then + raise("bin2obj: unsupported format '%s' (supported: coff, elf, macho)", format) + end end -- trace - print("converting binary file %s to %s object file %s ..", binarypath, format, outputpath) + print("converting binary file %s to %s object file %s ..", binarypath, format or "coff", outputpath) -- do conversion binutils.bin2obj(binarypath, outputpath, opt) |
