From b0cff135629b54963cec69368827f78155b830b0 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Wed, 27 Jul 2022 23:02:43 +0200 Subject: [PATCH] Restore VS runtime override (with an option to disable it) --- xmake.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xmake.lua b/xmake.lua index e63055a06..80367fbdf 100644 --- a/xmake.lua +++ b/xmake.lua @@ -125,6 +125,12 @@ option("embed-resources") set_description("Turn builtin resources into includable headers") option_end() +option("override_runtime") + set_default(true) + set_showmenu(true) + set_description("Override vs runtime to MD in release and MDd in debug") +option_end() + option("usepch") set_default(false) set_showmenu(true) @@ -197,6 +203,10 @@ end if is_plat("windows") then + if has_config("override_runtime") then + set_runtimes(is_mode("debug") and "MDd" or "MD") + end + add_defines("_CRT_SECURE_NO_WARNINGS") add_cxxflags("/bigobj", "/permissive-", "/Zc:__cplusplus", "/Zc:externConstexpr", "/Zc:inline", "/Zc:lambda", "/Zc:preprocessor", "/Zc:referenceBinding", "/Zc:strictStrings", "/Zc:throwingNew") add_cxflags("/w44062") -- Enable warning: switch case not handled