summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authormclee <[email protected]>2018-12-06 17:57:51 +0800
committermclee <[email protected]>2018-12-06 17:57:51 +0800
commit8a80645e856deeaa1df5ad6a2ef91a9c4d475cc8 (patch)
tree40eabbe127b7f445552868f3784404224c9ab552 /xmake/plugins
parent89e5de56f521e502db4311b99ed3f2fc5c196d1e (diff)
improves project plugin, and preprocessor definitions could be correctly setted now.
Diffstat (limited to 'xmake/plugins')
-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