diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 960bf1acf55..e33c40c418d 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -802,7 +802,7 @@ function _compargv_pch(self, pcheaderfile, pcoutputfile, flags, opt) local pchflags = {} local include = false for _, flag in ipairs(flags) do - if not flag:find("-include", 1, true) then + if not flag:startswith("-include") then if not include then table.insert(pchflags, flag) end