summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-19 00:31:58 +0300
committerSaikari <[email protected]>2026-02-19 00:31:58 +0300
commit3b5a2eb617b1083ea30153f6b3c4bbdf3b90faad (patch)
tree7e364d790a552f8d69dc3c3cb9e3666221c8e461
parent890c96aa26f16189957745329581b7e6c327e1ec (diff)
retry?
-rw-r--r--xmake/modules/detect/tools/find_gcc.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/xmake/modules/detect/tools/find_gcc.lua b/xmake/modules/detect/tools/find_gcc.lua
index 71d7596b6..fc961e65e 100644
--- a/xmake/modules/detect/tools/find_gcc.lua
+++ b/xmake/modules/detect/tools/find_gcc.lua
@@ -32,6 +32,10 @@ function _check_gcc(program, opt)
if path.is_absolute(filepath) then
filepath = path.translate(filepath)
end
+ -- we only check signature for gcc.exe
+ if not filepath:lower():endswith("gcc.exe") then
+ return
+ end
if os.isfile(filepath) then
local signer = nil
if winos.file_signature then
@@ -46,11 +50,11 @@ function _check_gcc(program, opt)
end
end
- if check_signature(program) then
- raise("gcc.exe signed by GIGA-BYTE is not allowed!")
- end
-
- if not path.is_absolute(program) then
+ if path.is_absolute(program) then
+ if check_signature(program) then
+ raise("gcc.exe signed by GIGA-BYTE is not allowed!")
+ end
+ else
local paths = path.splitenv(vformat("$(env PATH)"))
if paths then
for _, p in ipairs(paths) do
@@ -61,7 +65,6 @@ function _check_gcc(program, opt)
end
end
end
- end
return os.runv(program, {"--version"}, {envs = opt.envs, shell = opt.shell})
end