summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/tools/cmake.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 857f859be..57318328f 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -133,6 +133,10 @@ function _get_cflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
+ local vs_runtime = package:config("vs_runtime")
+ if vs_runtime then
+ table.insert(result, "/" .. vs_runtime)
+ end
if #result > 0 then
return os.args(result)
end
@@ -158,6 +162,10 @@ function _get_cxxflags(package, opt)
table.join2(result, opt.cxflags)
end
table.join2(result, _get_cflags_from_packagedeps(package, opt))
+ local vs_runtime = package:config("vs_runtime")
+ if vs_runtime then
+ table.insert(result, "/" .. vs_runtime)
+ end
if #result > 0 then
return os.args(result)
end
@@ -271,12 +279,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
@@ -739,4 +741,3 @@ function install(package, configs, opt)
end
os.cd(oldir)
end
-