summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxq114 <[email protected]>2022-02-25 22:35:24 +0800
committerxq114 <[email protected]>2022-02-25 22:35:24 +0800
commit1bb2fd157c8b14c70a1853ea60dd1849de27327d (patch)
treef29eba0a94640470522dde60b1f2be9f26c0f97a
parentd80e793b39693e153ceae6e54691a380578bd2ed (diff)
make excluding more precise
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 1bdcc215c..efb2caddb 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -118,7 +118,7 @@ function _exclude_flags(flags, excludes)
for _, flag in ipairs(flags) do
local excluded = false
for _, exclude in ipairs(excludes) do
- if flag:find("[%-/]" .. exclude) then
+ if flag:find("^[%-/]" .. exclude) then
excluded = true
break
end
@@ -502,7 +502,7 @@ function _make_source_options_cuda(vcxprojfile, flags, opt)
vcxprojfile:print("<Optimization%s>O1</Optimization>", condition)
elseif flagstr:find("[%-/]O2") then
vcxprojfile:print("<Optimization%s>O2</Optimization>", condition)
- elseif flagstr:find("[%-/]Ox") then
+ elseif flagstr:find("[%-/]O3") or flagstr:find("[%-/]Ox") then
vcxprojfile:print("<Optimization%s>O3</Optimization>", condition)
end
@@ -562,11 +562,14 @@ function _make_source_options_cuda(vcxprojfile, flags, opt)
end
if arch then
if not code then
- code = arch:gsub("sm", "compute")
+ code = arch
+ arch = arch:gsub("sm", "compute")
+ table.insert(gencodes, arch .. "," .. arch)
end
table.insert(gencodes, arch .. "," .. code)
end
if #gencodes > 0 then
+ gencodes = table.unique(gencodes)
vcxprojfile:print("<CodeGeneration%s>%s</CodeGeneration>", condition, table.concat(gencodes, ";"))
end
end
@@ -623,7 +626,7 @@ function _make_source_options_cuda(vcxprojfile, flags, opt)
-- make AdditionalOptions
local excludes = {
- "Od", "O1", "O2", "Ox", "W1", "W2", "W3", "W4", "Wall", "I", "D", "L", "l", "m", "%-machine", "gencode", "arch", "code", "cudart", "G", "use_fast_math", "rdc", "%-keep", "%-keep%-dir"
+ "Od", "O1", "O2", "O3", "Ox", "W1", "W2", "W3", "W4", "Wall", "I", "D", "L", "l", "m", "%-machine", "gencode", "arch", "code", "cudart", "G", "use_fast_math", "rdc", "%-keep", "%-keep%-dir"
}
local additional_flags = _exclude_flags(flags, excludes)
if #additional_flags > 0 then