From db41e5b8e4fc20027a4fdfd1b0bbe9985ee5ffb2 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 17 Jul 2023 22:39:09 +0800 Subject: fix set_pmheader --- xmake/modules/core/tools/gcc.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xmake/modules/core/tools/gcc.lua') diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 35b296ef0..cfd5fac5c 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -651,13 +651,19 @@ function _compargv_pch(self, pcheaderfile, pcoutputfile, flags) end end - -- compile header.h as c++? + -- set the language of precompiled header? if self:kind() == "cxx" then table.insert(pchflags, "-x") table.insert(pchflags, "c++-header") + elseif self:kind() == "cc" then + table.insert(pchflags, "-x") + table.insert(pchflags, "c-header") elseif self:kind() == "mxx" then table.insert(pchflags, "-x") table.insert(pchflags, "objective-c++-header") + elseif self:kind() == "mm" then + table.insert(pchflags, "-x") + table.insert(pchflags, "objective-c-header") end -- make the compile arguments list -- cgit v1.3.1