summaryrefslogtreecommitdiff
path: root/xmake/rules/plugin
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-08 17:50:23 +0800
committerGitHub <[email protected]>2021-12-08 17:50:23 +0800
commitdb817226c8c99eb497a2350c609321e2422f7041 (patch)
tree0e4fd63be51359e9b7772579af002e979bb221d9 /xmake/rules/plugin
parent23494057ededc3a8ae786c751c781de9c2c50564 (diff)
Update xmake.lua
Diffstat (limited to 'xmake/rules/plugin')
-rw-r--r--xmake/rules/plugin/vsxmake/xmake.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/rules/plugin/vsxmake/xmake.lua b/xmake/rules/plugin/vsxmake/xmake.lua
index 557d8ed4b..bb0f231e4 100644
--- a/xmake/rules/plugin/vsxmake/xmake.lua
+++ b/xmake/rules/plugin/vsxmake/xmake.lua
@@ -21,7 +21,7 @@
-- update vsxmake project automatically
--
-- @code
--- add_rules("plugin.vsxmake.autoupdate", {outputdir = "xxx"})
+-- add_rules("plugin.vsxmake.autoupdate")
-- target("test")
-- set_kind("binary")
-- add_files("src/*.c")
@@ -35,13 +35,17 @@ rule("plugin.vsxmake.autoupdate")
import("core.project.config")
import("core.project.depend")
import("core.project.project")
+ import("core.cache.localcache")
import("core.base.task")
-- run only once for all xmake process in vs
local tmpfile = path.join(config.buildir(), ".gens", "rules", "plugin.vsxmake.autoupdate")
local dependfile = tmpfile .. ".d"
local lockfile = io.openlock(tmpfile .. ".lock")
- local outputdir = project.extraconf("target.rules", "plugin.vsxmake.autoupdate", "outputdir")
+ local kind = localcache.get("vsxmake", "kind")
+ local modes = localcache.get("vsxmake", "modes")
+ local archs = localcache.get("vsxmake", "archs")
+ local outputdir = localcache.get("vsxmake", "outputdir")
if lockfile:trylock() then
if os.getenv("XMAKE_IN_VSTUDIO") then
local sourcefiles = {}
@@ -51,8 +55,8 @@ rule("plugin.vsxmake.autoupdate")
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", outputdir = outputdir})
+ print("update vsxmake project -k %s %s ..", kind or "vsxmake", outputdir or "")
+ task.run("project", {kind = kind or "vsxmake", modes = modes, archs = archs, outputdir = outputdir})
print("update vsxmake project ok")
end, {dependfile = dependfile,
files = project.allfiles(),