From 8e286dbab27c3f592f8379185c43ca0cc930d34f Mon Sep 17 00:00:00 2001 From: 夕伽 Date: Mon, 3 Sep 2018 08:26:50 +0800 Subject: 1 string.lower(xxx) -> xxx:lower() 2 -DUNICODE -> [%-|/]DUNICODE --- xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua | 4 ++-- xmake/plugins/project/vstudio/impl/vs201x.lua | 2 +- xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua index 91c287c08..e907f0599 100644 --- a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua @@ -234,7 +234,7 @@ function _make_VCLinkerTool(vcprojfile, vsinfo, target, vcprojdir) -- subsystem, console: 1, windows: 2 local subsystem = 1 local flags = _make_linkflags(target, vcprojdir) - if string.lower(flags):find("[%-/]subsystem:windows") then + if flags:lower():find("[%-/]subsystem:windows") then subsystem = 2 end @@ -284,7 +284,7 @@ function _make_configurations(vcprojfile, vsinfo, target, vcprojdir) -- set unicode and mfc local unicode = false for _, flag in pairs(compflags) do - if flag:find("-DUNICODE") then + if flag:find("[%-|/]DUNICODE") then unicode = true elseif flag:find("[%-|/]MT") then mfc = ifelse(mfc ~= 0, 1, 0) diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index bcdd45ddd..8671ea508 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -97,7 +97,7 @@ function _make_targetinfo(mode, arch, target) targetinfo.mfc = ifelse(target:values("mfc"), "Dynamic", nil) -- set unicode and mfc for _, flag in pairs(firstcompflags) do - if flag:find("-DUNICODE") then + if flag:find("[%-|/]DUNICODE") then targetinfo.unicode = true elseif flag:find("[%-|/]MT") then targetinfo.mfc = ifelse(targetinfo.mfc, "Static", false) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 4e96a4fe1..547414307 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -338,7 +338,7 @@ function _make_common_item(vcxprojfile, vsinfo, target, targetinfo, vcxprojdir) local flags = {} for _, flag in ipairs(_make_linkflags(targetinfo, vcxprojdir)) do - local flag_lower = string.lower(flag) + local flag_lower = flag:lower() -- remove "-subsystem:windows" if flag_lower:find("[%-/]subsystem:windows") then -- cgit v1.3.1