diff options
| author | ruki <[email protected]> | 2023-10-24 22:53:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-10-24 22:53:05 +0800 |
| commit | 66b43560f7cf25b20ecb78a85dc17fe1f975bb48 (patch) | |
| tree | 52e461ab60c8c76d6b5a8ae8a379121991573df9 /xmake/modules/core/tools/cl.lua | |
| parent | 645d407a01aa69d35d5340c66f5e109583e4c427 (diff) | |
pass extras to tools
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 607f0f4d9..34927d179 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -88,7 +88,7 @@ function init(self) end -- make the symbol flags -function nf_symbols(self, levels, target) +function nf_symbols(self, levels, opt) local flags = nil local values = hashset.from(levels) if values:has("debug") then @@ -103,6 +103,7 @@ function nf_symbols(self, levels, target) -- generate *.pdb file local symbolfile = nil + local target = opt.target if target and target.symbolfile and not values:has("embed") then symbolfile = target:symbolfile() end @@ -296,7 +297,8 @@ function nf_includedir(self, dir) end -- make the force include flag -function nf_forceinclude(self, headerfile, target) +function nf_forceinclude(self, headerfile, opt) + local target = opt.target local sourcekinds = target and target:extraconf("forceincludes", headerfile, "sourcekinds") if not sourcekinds or table.contains(table.wrap(sourcekinds), self:kind()) then return {"-FI", headerfile} @@ -377,8 +379,9 @@ function nf_encoding(self, encoding) end -- make the c precompiled header flag -function nf_pcheader(self, pcheaderfile, target) +function nf_pcheader(self, pcheaderfile, opt) if self:kind() == "cc" then + local target = opt.target local objectfiles = target:objectfiles() if objectfiles then table.insert(objectfiles, target:pcoutputfile("c") .. ".obj") @@ -388,8 +391,9 @@ function nf_pcheader(self, pcheaderfile, target) end -- make the c++ precompiled header flag -function nf_pcxxheader(self, pcheaderfile, target) +function nf_pcxxheader(self, pcheaderfile, opt) if self:kind() == "cxx" then + local target = opt.target local objectfiles = target:objectfiles() if objectfiles then table.insert(objectfiles, target:pcoutputfile("cxx") .. ".obj") |
