diff options
| author | jinke18 <[email protected]> | 2024-07-30 21:36:31 +0800 |
|---|---|---|
| committer | jinke18 <[email protected]> | 2024-07-30 21:36:31 +0800 |
| commit | 0f6285e094ceae1e3a7460150cdf482deccf03f7 (patch) | |
| tree | 17a79558fca3d8eba1538c2be2940683f360499c | |
| parent | fce49a0940ba7b950d37b5d0ad1217614c6e2bd5 (diff) | |
add /sdl and /Zc:inline flag support for `xmake project -k vs`
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 109094a55..f7f803469 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -494,11 +494,30 @@ function _make_source_options_cl(vcxprojfile, flags, condition) vcxprojfile:print("<CompileAs%s>CompileAsCpp</CompileAs>", condition) end + + -- make SDLCheck flag: /sdl + if flagstr:find("[%-/]sdl") then + if flagstr:find("[%-/]sdl%-") then + vcxprojfile:print("<SDLCheck%s>false</SDLCheck>", condition) + else + vcxprojfile:print("<SDLCheck%s>true</SDLCheck>", condition) + end + end + + -- make RemoveUnreferencedCodeData flag: Zc:inline + if flagstr:find("[%-/]Zc:inline") then + if flagstr:find("[%-/]Zc:inline%-") then + vcxprojfile:print("<RemoveUnreferencedCodeData%s>false</RemoveUnreferencedCodeData>", condition) + else + vcxprojfile:print("<RemoveUnreferencedCodeData%s>true</RemoveUnreferencedCodeData>", condition) + end + end + -- make AdditionalOptions local excludes = { "Od", "Os", "O0", "O1", "O2", "Ot", "Ox", "W0", "W1", "W2", "W3", "W4", "WX", "Wall", "Zi", "ZI", "Z7", "MT", "MTd", "MD", "MDd", "TP", "Fd", "fp", "I", "D", "Gm%-", "Gm", "GR%-", "GR", "MP", "external:W0", "external:W1", "external:W2", "external:W3", "external:W4", "external:templates%-?", "external:I", - "std:c11", "std:c17", "std:c%+%+11", "std:c%+%+14", "std:c%+%+17", "std:c%+%+20", "std:c%+%+latest", "nologo", "wd(%d+)" + "std:c11", "std:c17", "std:c%+%+11", "std:c%+%+14", "std:c%+%+17", "std:c%+%+20", "std:c%+%+latest", "nologo", "wd(%d+)", "sdl%-?", "Zc:inline%-?" } local additional_flags = _exclude_flags(flags, excludes) if #additional_flags > 0 then |
