summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/tools/cmake.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 40a1ad2e5..c13b48356 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -133,6 +133,12 @@ function _get_cflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
+ if package:is_plat("windows") then
+ local vs_runtime = package:config("vs_runtime")
+ if vs_runtime then
+ table.insert(result, "/" .. vs_runtime)
+ end
+ end
if #result > 0 then
return os.args(result)
end
@@ -158,6 +164,12 @@ function _get_cxxflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
+ if package:is_plat("windows") then
+ local vs_runtime = package:config("vs_runtime")
+ if vs_runtime then
+ table.insert(result, "/" .. vs_runtime)
+ end
+ end
if #result > 0 then
return os.args(result)
end
@@ -271,12 +283,6 @@ function _get_configs_for_windows(package, configs, opt)
elseif vs_runtime == "MDd" then
table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL")
end
- if vs_runtime then
- table.insert(configs, '-DCMAKE_CXX_FLAGS_DEBUG="/' .. vs_runtime .. '"')
- table.insert(configs, '-DCMAKE_CXX_FLAGS_RELEASE="/' .. vs_runtime .. '"')
- table.insert(configs, '-DCMAKE_C_FLAGS_DEBUG="/' .. vs_runtime .. '"')
- table.insert(configs, '-DCMAKE_C_FLAGS_RELEASE="/' .. vs_runtime .. '"')
- end
_get_configs_for_generic(package, configs, opt)
end
@@ -766,4 +772,3 @@ function install(package, configs, opt)
end
os.cd(oldir)
end
-