diff options
| author | ruki <[email protected]> | 2022-11-05 22:36:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-11-05 22:36:13 +0800 |
| commit | dd4684deff6e6208db83b41980f6cb4b04ea4d0b (patch) | |
| tree | 53c3dab6f58d02603741b5e65559772651498d91 | |
| parent | 5796e77bdb782277ecc82090496aebcea65aa87f (diff) | |
improve object file path
| -rw-r--r-- | xmake/core/project/target.lua | 5 |
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() |
