diff options
| author | ruki <[email protected]> | 2020-11-24 21:00:29 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-24 21:00:29 +0800 |
| commit | d7a9c248906663acb900a6fdce666e133d74aa9d (patch) | |
| tree | ad88b0ec69f2783d48fdd9dc580db45547125ebe | |
| parent | 75b047797a6fe2af068045c16979f8d6ac66b0cb (diff) | |
| parent | 559298e63f4e840a0e35645f85cf770219fd26c7 (diff) | |
Merge pull request #1066 from SirLynix/vsproj-multiprocessor
vsproj: Handle /Gm(-) and /MP
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index b228cef20..3a66a31d2 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("<RuntimeLibrary%s>MultiThreaded</RuntimeLibrary>", condition) end + -- handle multi processor compilation + if flagstr:find("[%-/]Gm-") or not flagstr:find("[%-/]Gm") then + vcxprojfile:print("<MinimalRebuild%s>false</MinimalRebuild>", condition) + if flagstr:find("[%-/]MP") then + vcxprojfile:print("<MultiProcessorCompilation%s>true</MultiProcessorCompilation>", 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 |
