Skip to content

Commit a133d58

Browse files
authored
Merge pull request #6819 from Shiffted/fix_show
Improve show target
2 parents d4da094 + a69e527 commit a133d58

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

xmake/plugins/show/info/target.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ function _show_target(target)
136136
print("The information of target(%s):", target:name())
137137
cprint(" ${color.dump.string}at${clear}: %s", path.join(target:scriptdir(), "xmake.lua"))
138138
cprint(" ${color.dump.string}kind${clear}: %s", target:kind())
139-
cprint(" ${color.dump.string}targetfile${clear}: %s", target:targetfile())
139+
local targetfile = target:targetfile()
140+
if targetfile then
141+
cprint(" ${color.dump.string}targetfile${clear}: %s", targetfile)
142+
end
140143
local deps = target:get("deps")
141144
if deps then
142145
cprint(" ${color.dump.string}deps${clear}:")
@@ -224,7 +227,7 @@ function _show_target(target)
224227
cprint(" ${color.dump.reference}->${clear} %s", os.args(compinst:compflags()))
225228
end
226229
end
227-
local linker = target:linker()
230+
local linker = targetfile and target:linker()
228231
if linker then
229232
cprint(" ${color.dump.string}linker (%s)${clear}: %s", linker:kind(), linker:program())
230233
cprint(" ${color.dump.reference}->${clear} %s", os.args(linker:linkflags()))
@@ -236,7 +239,6 @@ function _show_target(target)
236239
cprint(" ${color.dump.reference}->${clear} %s", os.args(compinst:compflags({target = target})))
237240
end
238241
end
239-
local linker = target:linker()
240242
if linker then
241243
cprint(" ${color.dump.string}linkflags (%s)${clear}:", linker:kind())
242244
cprint(" ${color.dump.reference}->${clear} %s", os.args(linker:linkflags({target = target})))

0 commit comments

Comments
 (0)