From 6b20a9e7a540337b03ec67c3a5ea5e13c03885bd Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 22 May 2022 21:54:42 +0800 Subject: improve moc --- xmake/rules/qt/moc/xmake.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/rules/qt/moc/xmake.lua b/xmake/rules/qt/moc/xmake.lua index 8b619677a..2e5e3db31 100644 --- a/xmake/rules/qt/moc/xmake.lua +++ b/xmake/rules/qt/moc/xmake.lua @@ -47,7 +47,8 @@ rule("qt.moc") if sourcefile:endswith(".cpp") then filename_moc = basename .. ".moc" end - local sourcefile_moc = path.join(target:autogendir(), "rules", "qt", "moc", filename_moc) + -- we need to retain the file directory structure, @see https://github.com/xmake-io/xmake/issues/2343 + local sourcefile_moc = target:autogenfile(path.join(path.directory(sourcefile), filename_moc)) -- add objectfile local objectfile = target:objectfile(sourcefile_moc) -- cgit v1.3.1