diff options
| author | ruki <[email protected]> | 2023-08-21 23:52:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-08-21 23:52:19 +0800 |
| commit | 6f7c5d97b77096be7d883aa98c398d6fdfa1a57e (patch) | |
| tree | e9ce802d35cc63aa12a14ca9070a5ce6fd017be4 /xmake/modules/core/tools/cl.lua | |
| parent | e426190309d4bca1642254902156d48b0e36f211 (diff) | |
rename to forceincludes
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 44e696f4b..7b0e81be0 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -281,16 +281,10 @@ 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 +-- 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 {"-FI", headerfile} end end |
