diff options
| author | ruki <[email protected]> | 2025-09-16 23:34:01 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-16 23:34:01 +0800 |
| commit | 1833ec0da4395ba3a25bd93d357eaee8083b8428 (patch) | |
| tree | 5b71deec0420164c35fd80a2ecca9e8749c3960d | |
| parent | 8f2b49d09f78829ebca18c910647421e3509c9b5 (diff) | |
Refactor clang check to use startswith method
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 4 |
1 files 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)} |
