diff options
| author | ruki <[email protected]> | 2025-09-17 09:37:18 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-17 09:37:18 +0800 |
| commit | a133d583ac95a4ecbdf646d54797886cc0389802 (patch) | |
| tree | 639f516502235c268a329871aeca2934e869f85b | |
| parent | d4da0944ead398d2e7eba985928adeba197557b7 (diff) | |
| parent | a69e527c0afbe87cd8373b4bced293bf00a020d6 (diff) | |
Merge pull request #6819 from Shiffted/fix_show
Improve show target
| -rw-r--r-- | xmake/plugins/show/info/target.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/plugins/show/info/target.lua b/xmake/plugins/show/info/target.lua index 7c9143a92..d5ddfbe76 100644 --- a/xmake/plugins/show/info/target.lua +++ b/xmake/plugins/show/info/target.lua @@ -136,7 +136,10 @@ function _show_target(target) print("The information of target(%s):", target:name()) cprint(" ${color.dump.string}at${clear}: %s", path.join(target:scriptdir(), "xmake.lua")) cprint(" ${color.dump.string}kind${clear}: %s", target:kind()) - cprint(" ${color.dump.string}targetfile${clear}: %s", target:targetfile()) + local targetfile = target:targetfile() + if targetfile then + cprint(" ${color.dump.string}targetfile${clear}: %s", targetfile) + end local deps = target:get("deps") if deps then cprint(" ${color.dump.string}deps${clear}:") @@ -224,7 +227,7 @@ function _show_target(target) cprint(" ${color.dump.reference}->${clear} %s", os.args(compinst:compflags())) end end - local linker = target:linker() + local linker = targetfile and target:linker() if linker then cprint(" ${color.dump.string}linker (%s)${clear}: %s", linker:kind(), linker:program()) cprint(" ${color.dump.reference}->${clear} %s", os.args(linker:linkflags())) @@ -236,7 +239,6 @@ function _show_target(target) cprint(" ${color.dump.reference}->${clear} %s", os.args(compinst:compflags({target = target}))) end end - local linker = target:linker() if linker then cprint(" ${color.dump.string}linkflags (%s)${clear}:", linker:kind()) cprint(" ${color.dump.reference}->${clear} %s", os.args(linker:linkflags({target = target}))) |
