summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-06 23:06:32 +0800
committerGitHub <[email protected]>2018-12-06 23:06:32 +0800
commitb03855d7dbc88bc38c07d7b62ea73de0dbbef9f6 (patch)
tree40eabbe127b7f445552868f3784404224c9ab552
parent89e5de56f521e502db4311b99ed3f2fc5c196d1e (diff)
parent8a80645e856deeaa1df5ad6a2ef91a9c4d475cc8 (diff)
Merge pull request #276 from orzuk-lmj/dev
improves project plugin, and preprocessor definitions could be correctly setted now.
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 494aeff51..2e7d1a426 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -288,6 +288,18 @@ function _make_source_options(vcxprojfile, flags, condition)
if flagstr:find("[%-/]WX") then
vcxprojfile:print("<TreatWarningAsError%s>true</TreatWarningAsError>", condition)
end
+
+ -- make PreprocessorDefinitions
+ local defstr = ""
+ for _, flag in ipairs(flags) do
+ flag:gsub("[%-/]D(.*)",
+ function (def)
+ defstr = defstr .. def .. ";"
+ end
+ )
+ end
+ defstr = defstr .. "%%(PreprocessorDefinitions)"
+ vcxprojfile:print("<PreprocessorDefinitions%s>%s</PreprocessorDefinitions>", condition, defstr)
-- make DebugInformationFormat
if flagstr:find("[%-/]Zi") then
@@ -329,7 +341,7 @@ function _make_source_options(vcxprojfile, flags, condition)
-- make AdditionalOptions
local additional_flags = {}
- local excludes = {"Os", "O0", "O1", "O2", "Ot", "Ox", "W0", "W1", "W2", "W3", "WX", "Wall", "Zi", "ZI", "Z7", "MT", "MTd", "MD", "MDd", "TP", "Fd", "fp", "I"}
+ local excludes = {"Od", "Os", "O0", "O1", "O2", "Ot", "Ox", "W0", "W1", "W2", "W3", "WX", "Wall", "Zi", "ZI", "Z7", "MT", "MTd", "MD", "MDd", "TP", "Fd", "fp", "I", "D"}
for _, flag in ipairs(flags) do
local excluded = false
for _, exclude in ipairs(excludes) do