From 1833ec0da4395ba3a25bd93d357eaee8083b8428 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Sep 2025 23:34:01 +0800 Subject: Refactor clang check to use startswith method --- xmake/modules/core/tools/gcc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 5824ae40d..f4cd684e0 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -867,7 +867,7 @@ function nf_pmheader(self, pcheaderfile, opt) if self:kind() == "mm" then local target = opt.target local pcoutputfile = target:pcoutputfile("m") - if self:name() == "clang" then + if self:name():startswith("clang") then return {"-include", pcheaderfile, "-include-pch", pcoutputfile} else return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)} @@ -880,7 +880,7 @@ function nf_pmxxheader(self, pcheaderfile, opt) if self:kind() == "mxx" then local target = opt.target local pcoutputfile = target:pcoutputfile("mxx") - if self:name() == "clang" then + if self:name():startswith("clang") then return {"-include", pcheaderfile, "-include-pch", pcoutputfile} else return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)} -- cgit v1.3.1