From 559298e63f4e840a0e35645f85cf770219fd26c7 Mon Sep 17 00:00:00 2001 From: Jérôme Leclercq Date: Tue, 24 Nov 2020 13:55:01 +0100 Subject: vsproj: Handle /Gm(-) and /MP --- xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 8188d401c..965559cbd 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -313,6 +313,14 @@ function _make_source_options(vcxprojfile, flags, condition) vcxprojfile:print("MultiThreaded", condition) end + -- handle multi processor compilation + if flagstr:find("[%-/]Gm-") or not flagstr:find("[%-/]Gm") then + vcxprojfile:print("false", condition) + if flagstr:find("[%-/]MP") then + vcxprojfile:print("true", condition) + end + end + -- make AdditionalIncludeDirectories if flagstr:find("[%-/]I") then local dirs = {} @@ -331,7 +339,7 @@ function _make_source_options(vcxprojfile, flags, condition) -- make AdditionalOptions local additional_flags = {} - 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"} + 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", "Gm-", "Gm"} for _, flag in ipairs(flags) do local excluded = false for _, exclude in ipairs(excludes) do -- cgit v1.3.1