summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-11-01 23:40:56 +0800
committerruki <[email protected]>2022-11-01 23:40:56 +0800
commite3f66afa1533661eda37f934357623134dd0e467 (patch)
treeb3ad5e6712accd0a4e60201f70cc828226a83ae4
parent919c16a9b5ac359117172c9d57e53bcbd77328d1 (diff)
improve to fix package path
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 045e6a02f..b8424f940 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -201,7 +201,12 @@ function _fix_paths_for_precompiled_package(package)
local filepattern = path.join(package:installdir(), filepat)
for _, file in ipairs(os.files(filepattern)) do
if remote_prefix then
- io.replace(file, remote_prefix, local_prefix, {plain = true})
+ local _, count = io.replace(file, remote_prefix, local_prefix, {plain = true})
+ -- maybe we need translate path seperator
+ -- @see https://github.com/xmake-io/xmake/discussions/3008
+ if count == 0 and is_host("windows") then
+ io.replace(file, (remote_prefix:gsub("\\", "/")), local_prefix:gsub("\\", "/"), {plain = true})
+ end
else
for _, search_pattern in ipairs(pat.search_pattern) do
_fix_path_for_file(file, search_pattern)