summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua15
-rw-r--r--xmake/plugins/project/vsxmake/vsxmake.lua15
2 files changed, 30 insertions, 0 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index 8980d0449..28454ba6e 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -35,6 +35,18 @@ import("actions.require.install", {alias = "install_requires", rootdir = os.prog
import("actions.config.configfiles", {alias = "generate_configfiles", rootdir = os.programdir()})
import("actions.config.configheader", {alias = "generate_configheader", rootdir = os.programdir()})
+-- clear cache configuration
+function _clear_cacheconf()
+ config.clear()
+ config.save()
+ localcache.clear("config")
+ localcache.clear("detect")
+ localcache.clear("option")
+ localcache.clear("package")
+ localcache.clear("toolchain")
+ localcache.save()
+end
+
-- make target info
function _make_targetinfo(mode, arch, target)
@@ -308,6 +320,9 @@ function make(outputdir, vsinfo)
vs201x_vcxproj_filters.make(vsinfo, target)
end
+ -- clear config and local cache
+ _clear_cacheconf()
+
-- leave project directory
os.cd(oldir)
end
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua
index 926533dbf..3594cf7e2 100644
--- a/xmake/plugins/project/vsxmake/vsxmake.lua
+++ b/xmake/plugins/project/vsxmake/vsxmake.lua
@@ -24,6 +24,7 @@ import("vstudio.impl.vsinfo", { rootdir = path.directory(os.scriptdir()) })
import("render")
import("getinfo")
import("core.project.config")
+import("core.cache.localcache")
local template_root = path.join(os.scriptdir(), "vsproj", "templates")
local template_sln = path.join(template_root, "sln", "vsxmake.sln")
@@ -166,6 +167,17 @@ function _writefileifneeded(file, content)
io.writefile(file, content)
end
+function _clear_cacheconf()
+ config.clear()
+ config.save()
+ localcache.clear("config")
+ localcache.clear("detect")
+ localcache.clear("option")
+ localcache.clear("package")
+ localcache.clear("toolchain")
+ localcache.save()
+end
+
-- make
function make(version)
@@ -215,5 +227,8 @@ function make(version)
_trycp(template_items, proj_dir)
_trycp(template_itemfil, proj_dir)
end
+
+ -- clear config and local cache
+ _clear_cacheconf()
end
end