Skip to content

Commit 1833ec0

Browse files
authored
Refactor clang check to use startswith method
1 parent 8f2b49d commit 1833ec0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xmake/modules/core/tools/gcc.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ function nf_pmheader(self, pcheaderfile, opt)
867867
if self:kind() == "mm" then
868868
local target = opt.target
869869
local pcoutputfile = target:pcoutputfile("m")
870-
if self:name() == "clang" then
870+
if self:name():startswith("clang") then
871871
return {"-include", pcheaderfile, "-include-pch", pcoutputfile}
872872
else
873873
return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)}
@@ -880,7 +880,7 @@ function nf_pmxxheader(self, pcheaderfile, opt)
880880
if self:kind() == "mxx" then
881881
local target = opt.target
882882
local pcoutputfile = target:pcoutputfile("mxx")
883-
if self:name() == "clang" then
883+
if self:name():startswith("clang") then
884884
return {"-include", pcheaderfile, "-include-pch", pcoutputfile}
885885
else
886886
return {"-I", path.directory(pcoutputfile), "-include", path.filename(pcheaderfile)}

0 commit comments

Comments
 (0)