diff --git a/xmake/rules/qt/ts/xmake.lua b/xmake/rules/qt/ts/xmake.lua index ad9fd698f9d..6ddfeb70302 100644 --- a/xmake/rules/qt/ts/xmake.lua +++ b/xmake/rules/qt/ts/xmake.lua @@ -51,12 +51,13 @@ rule("qt.ts") -- get lrelease local lrelease = target:data("qt.ts.lrelease") local outputdir = target:targetdir() - if target:fileconfig(sourcefile_ts) and target:fileconfig(sourcefile_ts).prefixdir then - outputdir = path.join(target:targetdir(), target:fileconfig(sourcefile_ts).prefixdir) + local fileconfig = target:fileconfig(sourcefile_ts) + if fileconfig and fileconfig.prefixdir then + outputdir = path.join(target:targetdir(), fileconfig.prefixdir) end local outfile = path.join(outputdir, path.basename(sourcefile_ts) .. ".qm") batchcmds:mkdir(outputdir) batchcmds:show_progress(opt.progress, "${color.build.object}compiling.qt.ts %s", sourcefile_ts) batchcmds:vrunv(lrelease, {path(sourcefile_ts), "-qm", path(outfile)}) batchcmds:add_depfiles(sourcefile_ts) - end) \ No newline at end of file + end)