diff options
| author | ruki <[email protected]> | 2023-03-16 09:14:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-16 09:14:50 +0800 |
| commit | b2acc71b278a95d6a6e57861fe482f64d6238bc9 (patch) | |
| tree | bcfff34e081412197a2e1dec758643df5e4547bb | |
| parent | e653ad7c7338f23b86eeaea1207176dc0e375d05 (diff) | |
| parent | 056d8cd83589f84254c0a4c9fdd4d84c06eddc96 (diff) | |
Merge pull request #3512 from xmake-io/autoupdate
add XMAKE_IN_XREPO
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/rules/plugin/compile_commands/xmake.lua | 5 | ||||
| -rw-r--r-- | xmake/rules/plugin/vsxmake/xmake.lua | 2 |
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()) |
