diff options
| author | ruki <[email protected]> | 2023-08-21 23:52:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-08-21 23:52:30 +0800 |
| commit | 00152ce33ad7f5a306218fc3e39d50186fb45796 (patch) | |
| tree | 6b5b82a2a061cacf4819dbcb110b3acf3490cdab /xmake/modules | |
| parent | 6f7c5d97b77096be7d883aa98c398d6fdfa1a57e (diff) | |
check target is nil
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 7b0e81be0..069c96d86 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -283,7 +283,7 @@ end -- make the force include flag function nf_forceinclude(self, headerfile, target) - local sourcekinds = target:extraconf("forceincludes", headerfile, "sourcekinds") + local sourcekinds = target and target:extraconf("forceincludes", headerfile, "sourcekinds") if not sourcekinds or table.contains(table.wrap(sourcekinds), self:kind()) then return {"-FI", headerfile} end diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index bf52b8d29..84b0aca4a 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -280,7 +280,7 @@ end -- make the force include flag function nf_forceinclude(self, headerfile, target) - local sourcekinds = target:extraconf("forceincludes", headerfile, "sourcekinds") + local sourcekinds = target and target:extraconf("forceincludes", headerfile, "sourcekinds") if not sourcekinds or table.contains(table.wrap(sourcekinds), self:kind()) then return {"-include", headerfile} end |
