diff options
| author | ruki <[email protected]> | 2024-01-24 22:44:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-01-25 12:09:59 +0800 |
| commit | eb17b64f82042e754000c4ae57a6e7184b19b8b0 (patch) | |
| tree | 2669aecd91923c632ef85a96ddb5d66acf0ebd85 | |
| parent | fec77395b2f96bac0bde5cd4d79115fd6d4b377e (diff) | |
compatible with vs_runtime buildhash
| -rw-r--r-- | xmake/core/package/package.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 2435c8bf8..870fa63d5 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1539,6 +1539,15 @@ function _instance:buildhash() str = str .. label end if configs then + + -- with old vs_runtime configs + -- https://github.com/xmake-io/xmake/issues/4477 + if opt.vs_runtime then + configs = table.clone(configs) + configs.vs_runtime = configs.runtimes + configs.runtimes = nil + end + -- since luajit v2.1, the key order of the table is random and undefined. -- We cannot directly deserialize the table, so the result may be different each time local configs_order = {} @@ -1616,6 +1625,16 @@ function _instance:buildhash() end end + -- we need to be compatible with the previous xmake version + -- with deprecated vs_runtime (< 2.8.7) + -- @see https://github.com/xmake-io/xmake/issues/4477 + if not buildhash then + buildhash = _get_buildhash(self:_configs_for_buildhash(), {vs_runtime = true}) + if not os.isdir(_get_installdir(buildhash)) then + buildhash = nil + end + end + -- get build hash for current version if not buildhash then buildhash = _get_buildhash(self:_configs_for_buildhash()) |
