summaryrefslogtreecommitdiff
path: root/xmake/rules/c++
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-02 19:09:25 +0800
committerGitHub <[email protected]>2025-10-02 19:09:25 +0800
commitc62972f4def074c8b0b433e557a48d313bf77a18 (patch)
tree0a24c95b7e5f3b2c0b73c3a8857b77dee04842ea /xmake/rules/c++
parent553eceaccbddb35e8499b3a4332a5b798219f796 (diff)
parent6377f4494967e341150f0e2bb042d3c7d8bd15c9 (diff)
Merge pull request #6872 from xmake-io/opti
Improve hash
Diffstat (limited to 'xmake/rules/c++')
-rw-r--r--xmake/rules/c++/modules/support.lua4
-rw-r--r--xmake/rules/c++/unity_build/unity_build.lua2
2 files changed, 3 insertions, 3 deletions
diff --git a/xmake/rules/c++/modules/support.lua b/xmake/rules/c++/modules/support.lua
index 8d1c39531..cee0f1ab8 100644
--- a/xmake/rules/c++/modules/support.lua
+++ b/xmake/rules/c++/modules/support.lua
@@ -336,7 +336,7 @@ function modules_cachedir(target, opt)
moduletype = "interfaces"
elseif opt.scan then
moduletype = "scans"
- else
+ else
moduletype = "implementation"
end
local cachedir = path.join(target:autogendir(), "rules", "bmi", "cache", moduletype)
@@ -347,7 +347,7 @@ function modules_cachedir(target, opt)
end
function get_modulehash(sourcefile)
- return hash.uuid(sourcefile):split("-", {plain = true})[1]:lower()
+ return hash.strhash32(sourcefile)
end
function get_metafile(target, module)
diff --git a/xmake/rules/c++/unity_build/unity_build.lua b/xmake/rules/c++/unity_build/unity_build.lua
index e8f37f868..3df2d75b4 100644
--- a/xmake/rules/c++/unity_build/unity_build.lua
+++ b/xmake/rules/c++/unity_build/unity_build.lua
@@ -36,7 +36,7 @@ function _merge_unityfile(target, sourcefile_unity, sourcefiles, opt)
sourcefile_unity = path.absolute(sourcefile_unity)
sourcefile = path.relative(sourcefile, path.directory(sourcefile_unity))
if uniqueid then
- unityfile:print("#define %s %s", uniqueid, "unity_" .. hash.uuid():split("-", {plain = true})[1])
+ unityfile:print("#define %s %s", uniqueid, "unity_" .. hash.rand32())
end
unityfile:print("#include \"%s\"", sourcefile)
if uniqueid then