summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-21 23:42:12 +0800
committerruki <[email protected]>2023-08-21 23:42:12 +0800
commitd528d56c990bf06f99dcff2412fb19d9b1730c4f (patch)
treefdfa088e57da84c31e30c96c12522afe1c80acd4 /xmake/modules/core/tools
parente73df8b4713c4b8c928c77d0baa4185be1db6517 (diff)
add force includes #4101
Diffstat (limited to 'xmake/modules/core/tools')
-rw-r--r--xmake/modules/core/tools/cl.lua14
-rw-r--r--xmake/modules/core/tools/gcc.lua14
2 files changed, 28 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index b043370d1..44e696f4b 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -281,6 +281,20 @@ function nf_includedir(self, dir)
return {"-I" .. path.translate(dir)}
end
+-- make the force c include flag
+function nf_cinclude(self, headerfile)
+ if self:kind() == "cc" then
+ return {"-FI", headerfile}
+ end
+end
+
+-- make the force c++ include flag
+function nf_cxxinclude(self, headerfile)
+ if self:kind() == "cxx" then
+ return {"-FI", headerfile}
+ end
+end
+
-- make the sysincludedir flag
function nf_sysincludedir(self, dir)
local has_external_includedir = _g._HAS_EXTERNAL_INCLUDEDIR
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