From 9921a973ef37a89394f9a96366cd29eb70b6ba02 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Tue, 21 May 2019 18:15:21 +0800 Subject: simplify --- xmake/modules/core/tools/nvcc.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 5993e9bb8..b284313a7 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -106,7 +106,7 @@ function nf_warning(self, level) , everything = "-Weverything -Wall -Wextra -Weffc++" , error = "-Werror" } - + local warning = maps[level] local host_warning = nil @@ -118,12 +118,11 @@ function nf_warning(self, level) host_warning = gcc_clang_maps[level] end - if warning and host_warning then - warning = warning .. ' -Xcompiler "' .. host_warning .. '"' - elseif host_warning then - warning = '-Xcompiler "' .. host_warning .. '"' + if host_warning then + warning = ((warning or "") .. ' -Xcompiler "' .. host_warning .. '"'):trim() end return warning + end -- make the optimize flag -- cgit v1.3.1