diff options
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 37f1f345a..bf52b8d29 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -278,16 +278,10 @@ 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 +-- make the force include flag +function nf_forceinclude(self, headerfile, target) + local sourcekinds = target:extraconf("forceincludes", headerfile, "sourcekinds") + if not sourcekinds or table.contains(table.wrap(sourcekinds), self:kind()) then return {"-include", headerfile} end end |
