From dd4684deff6e6208db83b41980f6cb4b04ea4d0b Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 5 Nov 2022 22:36:13 +0800 Subject: improve object file path --- xmake/core/project/target.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 080b8249b..8e9e62ff4 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -26,6 +26,7 @@ local _instance = _instance or {} local bit = require("base/bit") local os = require("base/os") local path = require("base/path") +local hash = require("base/hash") local utils = require("base/utils") local table = require("base/table") local baseoption = require("base/option") @@ -1140,7 +1141,9 @@ function _instance:autogenfile(sourcefile, opt) -- we need replace '..' to '__' in this case -- if path.is_absolute(relativedir) and os.host() == "windows" then - relativedir = relativedir:gsub(":[\\/]*", '\\') -- replace C:\xxx\ => C\xxx\ + -- remove C:\\ and whitespaces + -- e.g. C:\\Program Files (x64)\\xxx\Windows.h + relativedir = hash.uuid4(relativedir):gsub("%-", ""):lower() end relativedir = relativedir:gsub("%.%.", "__") local rootdir = (opt and opt.rootdir) and opt.rootdir or self:autogendir() -- cgit v1.3.1