summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-15 23:29:14 +0800
committerruki <[email protected]>2019-03-15 14:55:26 +0800
commit62540eacb93339ebbdc36156834f4fc19aa19e64 (patch)
tree20fb871fec0887a3a6e748ea791dbd44bc125b05 /xmake/modules/package/tools
parentcc02a8d5a54dd46a63f0da144cfb35b12dcf3263 (diff)
pass vs runtime to package
Diffstat (limited to 'xmake/modules/package/tools')
-rw-r--r--xmake/modules/package/tools/cmake.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index cbcf99014..4f8cde55f 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -26,6 +26,19 @@
import("core.base.option")
import("lib.detect.find_file")
+-- get configs
+function _get_configs(package, configs)
+ local configs = configs or {}
+ local vs_runtime = package:config("vs_runtime")
+ if vs_runtime then
+ table.insert(configs, '-DCMAKE_CXX_FLAGS_DEBUG="/' .. vs_runtime .. 'd"')
+ table.insert(configs, '-DCMAKE_CXX_FLAGS_RELEASE="/' .. vs_runtime .. '"')
+ table.insert(configs, '-DCMAKE_C_FLAGS_DEBUG="/' .. vs_runtime .. 'd"')
+ table.insert(configs, '-DCMAKE_C_FLAGS_RELEASE="/' .. vs_runtime .. '"')
+ end
+ return configs
+end
+
-- install package
function install(package, configs)
@@ -39,7 +52,7 @@ function install(package, configs)
table.insert(argv, "-A")
table.insert(argv, "x64")
end
- for name, value in pairs(configs) do
+ for name, value in pairs(_get_configs(package, configs)) do
value = tostring(value):trim()
if type(name) == "number" then
if value ~= "" then