diff options
| author | ruki <[email protected]> | 2021-09-29 00:45:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-29 00:45:56 +0800 |
| commit | 169141eaa2158281f80aca5c30e17c9d1ace52d7 (patch) | |
| tree | 54e9676ea1bc67f92bf5dc810bea74222c610f67 | |
| parent | 1123617bd848a2328493f39b53b97e3ce707e7b3 (diff) | |
improve vs runtime for cmake generator again
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 7d8765055..ba1689cb1 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -383,16 +383,13 @@ function _add_target_vs_runtime(cmakelists, target) local vs_runtime = target:get("runtimes") if vs_runtime then cmakelists:print("if(MSVC)") - if vs_runtime == "MT" then - vs_runtime = "MultiThreaded" - elseif vs_runtime == "MTd" then - vs_runtime = "MultiThreadedDebug" - elseif vs_runtime == "MD" then - vs_runtime = "MultiThreadedDLL" - elseif vs_runtime == "MDd" then - vs_runtime = "MultiThreadedDebugDLL" + if vs_runtime:startswith("MT") then + vs_runtime = "MultiThreaded$<$<CONFIG:Debug>:Debug>" + elseif vs_runtime:startswith("MD") then + vs_runtime = "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" end - cmakelists:print(' set_property(TARGET %s PROPERTY MSVC_RUNTIME_LIBRARY "%s")', target:name(), vs_runtime) + cmakelists:print(' set_property(TARGET %s PROPERTY', target:name()) + cmakelists:print(' MSVC_RUNTIME_LIBRARY "%s")', vs_runtime) cmakelists:print("endif()") end end |
