diff options
Diffstat (limited to 'xmake/modules/core/tools/rustc.lua')
| -rw-r--r-- | xmake/modules/core/tools/rustc.lua | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/xmake/modules/core/tools/rustc.lua b/xmake/modules/core/tools/rustc.lua index ab41620cd..c16c6261c 100644 --- a/xmake/modules/core/tools/rustc.lua +++ b/xmake/modules/core/tools/rustc.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.config") import("core.project.project") +import("core.language.language") -- init it function init(self) @@ -29,16 +30,20 @@ end -- make the optimize flag function nf_optimize(self, level) - local maps = - { - none = "-C opt-level=0" - , fast = "-C opt-level=1" - , faster = "-C opt-level=2" - , fastest = "-C opt-level=3" - , smallest = "-C opt-level=s" - , aggressive = "-C opt-level=z" - } - return maps[level] + -- only for source kind + local kind = self:kind() + if language.sourcekinds()[kind] then + local maps = + { + none = "-C opt-level=0" + , fast = "-C opt-level=1" + , faster = "-C opt-level=2" + , fastest = "-C opt-level=3" + , smallest = "-C opt-level=s" + , aggressive = "-C opt-level=z" + } + return maps[level] + end end -- make the symbol flag |
