summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-22 00:49:25 +0800
committerruki <[email protected]>2020-12-22 00:49:25 +0800
commitcd8b5cba53d9abba2852d1152b1bd51ed865685f (patch)
tree95acff80b9685b84497d01968dc0d704f2bdb70d
parenta0b13369ce0d586993f09a072aadd20690bb9b92 (diff)
remove configcache
-rw-r--r--xmake/actions/config/main.lua13
-rw-r--r--xmake/core/cache/configcache.lua22
-rw-r--r--xmake/core/sandbox/modules/import/core/cache/configcache.lua23
-rw-r--r--xmake/core/tool/toolchain.lua2
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua3
5 files changed, 6 insertions, 57 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index cecd906aa..41aec5f75 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -27,7 +27,6 @@ import("core.project.project")
import("core.platform.platform")
import("private.detect.find_platform")
import("core.cache.localcache")
-import("core.cache.configcache")
import("scangen")
import("menuconf", {alias = "menuconf_show"})
import("configfiles", {alias = "generate_configfiles"})
@@ -70,7 +69,7 @@ function _need_check(changed)
-- get the previous mtimes
if not changed then
- local mtimes_prev = configcache:get("mtimes")
+ local mtimes_prev = localcache.get("config", "mtimes")
if mtimes_prev then
-- check for all project files
@@ -95,7 +94,7 @@ function _need_check(changed)
end
-- update mtimes
- configcache:set("mtimes", mtimes)
+ localcache.set("config", "mtimes", mtimes)
-- changed?
return changed
@@ -220,7 +219,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
-- override configure from the options or cache
local options_history = {}
if not option.get("clean") and not autogen then
- options_history = configcache:get("options") or {}
+ options_history = localcache.get("config", "options") or {}
options = options or options_history
end
for name, value in pairs(options) do
@@ -327,10 +326,8 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
-- save options and configure for the given target
config.save()
- configcache:set("options", options)
-
- -- save config cache
- configcache:save()
+ localcache.set("config", "options", options)
+ localcache.save("config")
-- unlock the whole project
project.unlock()
diff --git a/xmake/core/cache/configcache.lua b/xmake/core/cache/configcache.lua
deleted file mode 100644
index 889f7d1c4..000000000
--- a/xmake/core/cache/configcache.lua
+++ /dev/null
@@ -1,22 +0,0 @@
---!A cross-platform build utility based on Lua
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
--- Copyright (C) 2015-present, TBOOX Open Source Group.
---
--- @author ruki
--- @file configcache.lua
---
-
-return require("cache/localcache").cache("config")
-
diff --git a/xmake/core/sandbox/modules/import/core/cache/configcache.lua b/xmake/core/sandbox/modules/import/core/cache/configcache.lua
deleted file mode 100644
index ae0e4181c..000000000
--- a/xmake/core/sandbox/modules/import/core/cache/configcache.lua
+++ /dev/null
@@ -1,23 +0,0 @@
---!A cross-platform build utility based on Lua
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
--- Copyright (C) 2015-present, TBOOX Open Source Group.
---
--- @author ruki
--- @file configcache.lua
---
-
--- return module
-return require("cache/configcache")
-
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 872d63512..78caadc12 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -410,8 +410,6 @@ function toolchain._interpreter()
-- save interpreter
toolchain._INTERPRETER = interp
-
- -- ok?
return interp
end
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 4c78016c9..64a7be79b 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -24,7 +24,6 @@ import("core.base.semver")
import("core.base.hashset")
import("core.project.config")
import("core.project.project")
-import("core.cache.configcache")
import("core.platform.platform")
import("core.tool.compiler")
import("core.tool.linker")
@@ -156,7 +155,7 @@ function _make_targetinfo(mode, arch, target)
targetinfo.cxxlanguage = "stdcpp17"
end
local flags = {}
- for k, v in pairs(configcache:get("options_" .. target:name())) do
+ for k, v in pairs(localcache.get("config", "options_" .. target:name())) do
if k ~= "plat" and k ~= "mode" and k ~= "arch" and k ~= "clean" and k ~= "buildir" then
table.insert(flags, "--" .. k .. "=" .. tostring(v));
end