diff options
Diffstat (limited to 'xmake/rules/plugin/vsxmake/xmake.lua')
| -rw-r--r-- | xmake/rules/plugin/vsxmake/xmake.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xmake/rules/plugin/vsxmake/xmake.lua b/xmake/rules/plugin/vsxmake/xmake.lua index c37c38101..c1e9506ce 100644 --- a/xmake/rules/plugin/vsxmake/xmake.lua +++ b/xmake/rules/plugin/vsxmake/xmake.lua @@ -28,7 +28,8 @@ -- @endcode -- rule("plugin.vsxmake.autoupdate") - after_build(function (target) + set_kind("project") + after_build(function (opt) -- imports import("core.project.depend") @@ -37,17 +38,23 @@ rule("plugin.vsxmake.autoupdate") -- run only once for all xmake process in vs local tmpfile = os.tmpfile(path.join(os.projectdir(), "plugin.vsxmake.autoupdate")) + local dependfile = tmpfile .. ".d" local lockfile = io.openlock(tmpfile .. ".lock") if lockfile:trylock() then if os.getenv("XMAKE_IN_VSTUDIO") then + local sourcefiles = {} + for _, target in pairs(project.targets()) do + table.join2(sourcefiles, (target:sourcefiles())) + end + table.sort(sourcefiles) depend.on_changed(function () -- we use task instead of os.exec("xmake") to avoid the project lock print("update vsxmake project ..") task.run("project", {kind = "vsxmake"}) print("update vsxmake project ok") - end, {dependfile = tmpfile .. ".d", + end, {dependfile = dependfile, files = project.allfiles(), - values = target:sourcefiles()}) + values = sourcefiles}) end lockfile:close() end |
