summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-16 19:30:30 +0300
committerSaikari <[email protected]>2026-02-16 19:30:30 +0300
commit1ef8c05c510484e3d7e608c87abcb65efe3a5aba (patch)
treead068cd99803e1d8a2a22ffc0c7770cb48f5f009
parent86b1f8b1211116c718c789146033f70cd14a0c65 (diff)
retry find_gcc
-rw-r--r--xmake/modules/detect/tools/find_gcc.lua42
1 files changed, 22 insertions, 20 deletions
diff --git a/xmake/modules/detect/tools/find_gcc.lua b/xmake/modules/detect/tools/find_gcc.lua
index f2f1d456e..1a0cf4b78 100644
--- a/xmake/modules/detect/tools/find_gcc.lua
+++ b/xmake/modules/detect/tools/find_gcc.lua
@@ -22,33 +22,35 @@
import("lib.detect.find_program")
import("lib.detect.find_programver")
import("core.cache.detectcache")
-import("core.base.winos")
-- check gigabyte gcc
function _check_gigabyte_gcc(program)
-- avoid gcc.exe signed by GIGA-BYTE ref: https://github.com/xmake-io/xmake/issues/5629
- if winos.file_signature and program:lower():endswith("gcc.exe") then
- local check_signature = function (program)
- if os.isfile(program) then
- local signer = winos.file_signature(program)
- if signer and signer.signer_name and signer.signer_name:startswith("GIGA-BYTE") then
- return true
+ if is_plat("windows", "mingw") and program:lower():endswith("gcc.exe") then
+ import("core.base.winos")
+ if winos.file_signature then
+ local check_signature = function (program)
+ if os.isfile(program) then
+ local signer = winos.file_signature(program)
+ if signer and signer.signer_name and signer.signer_name:startswith("GIGA-BYTE") then
+ return true
+ end
end
end
- end
- if path.is_absolute(program) then
- if check_signature(program) then
- return false
- end
- else
- local paths = path.splitenv(vformat("$(env PATH)"))
- for _, p in ipairs(paths) do
- local prog = path.join(p, program)
- if os.isfile(prog) then
- if check_signature(prog) then
- return false
+ if path.is_absolute(program) then
+ if check_signature(program) then
+ return false
+ end
+ else
+ local paths = path.splitenv(vformat("$(env PATH)"))
+ for _, p in ipairs(paths) do
+ local prog = path.join(p, program)
+ if os.isfile(prog) then
+ if check_signature(prog) then
+ return false
+ end
+ break
end
- break
end
end
end