From d80e793b39693e153ceae6e54691a380578bd2ed Mon Sep 17 00:00:00 2001
From: xq114 <1140735506@qq.com>
Date: Fri, 25 Feb 2022 22:08:11 +0800
Subject: support msvc style flags for nvcc
---
xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'xmake/plugins/project/vstudio/impl')
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 0a83e982b..1bdcc215c 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -517,7 +517,7 @@ function _make_source_options_cuda(vcxprojfile, flags, opt)
-- make Defines
local defstr = ""
for _, flag in ipairs(flags) do
- flag:gsub("%-D(.*)",
+ flag:gsub("[%-/]D(.*)",
function (def)
defstr = defstr .. vsutils.escape(def) .. ";"
end
@@ -527,10 +527,10 @@ function _make_source_options_cuda(vcxprojfile, flags, opt)
vcxprojfile:print("%s", condition, defstr)
-- make Include
- if flagstr:find("%-I") then
+ if flagstr:find("[%-/]I") then
local dirs = {}
for _, flag in ipairs(flags) do
- flag:gsub("%-I(.*)", function (dir) table.insert(dirs, vsutils.escape(dir)) end)
+ flag:gsub("[%-/]I(.*)", function (dir) table.insert(dirs, vsutils.escape(dir)) end)
end
if #dirs > 0 then
vcxprojfile:print("%s", condition, table.concat(dirs, ";"))
--
cgit v1.3.1