diff options
| author | ruki <[email protected]> | 2024-09-16 22:38:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-09-16 22:38:51 +0800 |
| commit | 95db53c2338b030d0dd99620d388882a3faeb653 (patch) | |
| tree | 86e00359e1cdd16e300ea2d0e840cd9e3101b78f | |
| parent | f9196dfa7073e3c3511230072d606c89f28a075d (diff) | |
add vs runtime policy
| -rw-r--r-- | xmake/core/project/policy.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua index e82774a0c..acfcc2a0e 100644 --- a/xmake/core/project/policy.lua +++ b/xmake/core/project/policy.lua @@ -84,6 +84,8 @@ function policy.policies() ["build.c++.clang.fallbackscanner"] = {description = "Force clang fallback module dependency scanner.", default = false, type = "boolean"}, -- Force C++ modules fallback dependency scanner for msvc ["build.c++.msvc.fallbackscanner"] = {description = "Force msvc fallback module dependency scanner.", default = false, type = "boolean"}, + -- Set the default vs runtime, e.g. MT, MD + ["build.c++.msvc.runtime"] = {description = "Set the default vs runtime.", default = "MT", type = "string"}, -- Force C++ modules fallback dependency scanner for gcc ["build.c++.gcc.fallbackscanner"] = {description = "Force gcc fallback module dependency scanner.", default = false, type = "boolean"}, -- Force to enable new cxx11 abi in C++ modules for gcc diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 836ece6b6..b6c7e6334 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -827,8 +827,10 @@ function project._init_default_policies() if compatibility_version then if semver.compare(compatibility_version, "3.0") >= 0 then policy.set_default("package.cmake_generator.ninja", true) + policy.set_default("build.c++.msvc.runtime", "MD") else policy.set_default("package.cmake_generator.ninja", false) + policy.set_default("build.c++.msvc.runtime", "MT") end end end |
