From 1a758e59eeec08e6bd04d8c2c94e98f8ad00dba4 Mon Sep 17 00:00:00 2001 From: ShifftC Date: Tue, 16 Sep 2025 17:36:41 +0200 Subject: show: don't print nil targetfile --- xmake/plugins/show/info/target.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmake/plugins/show/info/target.lua b/xmake/plugins/show/info/target.lua index 7c9143a92..93648e716 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}:") -- cgit v1.3.1 From a69e527c0afbe87cd8373b4bced293bf00a020d6 Mon Sep 17 00:00:00 2001 From: ShifftC Date: Tue, 16 Sep 2025 18:10:56 +0200 Subject: show: fix linker info for non-linkable targets --- xmake/plugins/show/info/target.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xmake/plugins/show/info/target.lua b/xmake/plugins/show/info/target.lua index 93648e716..d5ddfbe76 100644 --- a/xmake/plugins/show/info/target.lua +++ b/xmake/plugins/show/info/target.lua @@ -227,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())) @@ -239,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}))) -- cgit v1.3.1