summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-11-05 22:36:13 +0800
committerruki <[email protected]>2022-11-05 22:36:13 +0800
commitdd4684deff6e6208db83b41980f6cb4b04ea4d0b (patch)
tree53c3dab6f58d02603741b5e65559772651498d91
parent5796e77bdb782277ecc82090496aebcea65aa87f (diff)
improve object file path
-rw-r--r--xmake/core/project/target.lua5
1 files changed, 4 insertions, 1 deletions
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()