summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/tools/xmake.lua1
-rw-r--r--xmake/rules/plugin/compile_commands/xmake.lua5
-rw-r--r--xmake/rules/plugin/vsxmake/xmake.lua2
3 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index 71e23a328..8788ed6f8 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -241,6 +241,7 @@ function buildenvs(package, opt)
local envs = _get_package_toolchains_envs(package, opt)
-- we should avoid using $XMAKE_CONFIGDIR outside to cause conflicts
envs.XMAKE_CONFIGDIR = os.curdir()
+ envs.XMAKE_IN_XREPO = "1"
return envs
end
diff --git a/xmake/rules/plugin/compile_commands/xmake.lua b/xmake/rules/plugin/compile_commands/xmake.lua
index 9e44eb631..b834a4790 100644
--- a/xmake/rules/plugin/compile_commands/xmake.lua
+++ b/xmake/rules/plugin/compile_commands/xmake.lua
@@ -37,6 +37,11 @@ rule("plugin.compile_commands.autoupdate")
import("core.project.project")
import("core.base.task")
+ -- we should not update it if we are installing xmake package
+ if os.getenv("XMAKE_IN_XREPO") then
+ return
+ end
+
-- run only once for all xmake process in vs
local tmpfile = path.join(config.buildir(), ".gens", "rules", "plugin.compile_commands.autoupdate")
local dependfile = tmpfile .. ".d"
diff --git a/xmake/rules/plugin/vsxmake/xmake.lua b/xmake/rules/plugin/vsxmake/xmake.lua
index bb0f231e4..50139010e 100644
--- a/xmake/rules/plugin/vsxmake/xmake.lua
+++ b/xmake/rules/plugin/vsxmake/xmake.lua
@@ -47,7 +47,7 @@ rule("plugin.vsxmake.autoupdate")
local archs = localcache.get("vsxmake", "archs")
local outputdir = localcache.get("vsxmake", "outputdir")
if lockfile:trylock() then
- if os.getenv("XMAKE_IN_VSTUDIO") then
+ if os.getenv("XMAKE_IN_VSTUDIO") and not os.getenv("XMAKE_IN_XREPO") then
local sourcefiles = {}
for _, target in pairs(project.targets()) do
table.join2(sourcefiles, target:sourcefiles(), target:headerfiles())