From d528d56c990bf06f99dcff2412fb19d9b1730c4f Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 21 Aug 2023 23:42:12 +0800 Subject: add force includes #4101 --- xmake/modules/core/tools/gcc.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (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 60bfc8e5e..37f1f345a 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -278,6 +278,20 @@ function nf_sysincludedir(self, dir) return {"-isystem", path.translate(dir)} end +-- make the force c include flag +function nf_cinclude(self, headerfile) + if self:kind() == "cc" then + return {"-include", headerfile} + end +end + +-- make the force c++ include flag +function nf_cxxinclude(self, headerfile) + if self:kind() == "cxx" then + return {"-include", headerfile} + end +end + -- make the link flag function nf_link(self, lib) if lib:endswith(".a") or lib:endswith(".so") or lib:endswith(".dylib") or lib:endswith(".lib") then -- cgit v1.3.1