@@ -136,7 +136,10 @@ function _show_target(target)
136
136
print (" The information of target(%s):" , target :name ())
137
137
cprint (" ${color.dump.string}at${clear}: %s" , path .join (target :scriptdir (), " xmake.lua" ))
138
138
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
140
143
local deps = target :get (" deps" )
141
144
if deps then
142
145
cprint (" ${color.dump.string}deps${clear}:" )
@@ -224,7 +227,7 @@ function _show_target(target)
224
227
cprint (" ${color.dump.reference}->${clear} %s" , os .args (compinst :compflags ()))
225
228
end
226
229
end
227
- local linker = target :linker ()
230
+ local linker = targetfile and target :linker ()
228
231
if linker then
229
232
cprint (" ${color.dump.string}linker (%s)${clear}: %s" , linker :kind (), linker :program ())
230
233
cprint (" ${color.dump.reference}->${clear} %s" , os .args (linker :linkflags ()))
@@ -236,7 +239,6 @@ function _show_target(target)
236
239
cprint (" ${color.dump.reference}->${clear} %s" , os .args (compinst :compflags ({target = target })))
237
240
end
238
241
end
239
- local linker = target :linker ()
240
242
if linker then
241
243
cprint (" ${color.dump.string}linkflags (%s)${clear}:" , linker :kind ())
242
244
cprint (" ${color.dump.reference}->${clear} %s" , os .args (linker :linkflags ({target = target })))
0 commit comments