summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-12 22:30:09 +0800
committerruki <[email protected]>2022-10-12 22:30:09 +0800
commitf931f32b33228f0efadbb7942507047b570a7cda (patch)
treefc7cbb377d2ca432237bd4f462c76343c9b65a9e
parent08de4150b1af224e8575b0574fb62d20fa7f08be (diff)
improve to check package links
-rw-r--r--xmake/core/package/package.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index d65d35e6d..131784172 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1793,6 +1793,16 @@ function _instance:_generate_build_configs(configs, opt)
if self:is_plat("windows") then
local ld = self:build_getenv("ld")
local vs_runtime = self:config("vs_runtime")
+ -- since we are ignoring the vs_runtime of the headeronly library,
+ -- we can only get the vs_runtime from the dependency library to detect the link.
+ if self:is_headeronly() and not vs_runtime and self:librarydeps() then
+ for _, dep in ipairs(self:librarydeps()) do
+ if dep:is_plat("windows") and dep:config("vs_runtime") then
+ vs_runtime = dep:config("vs_runtime")
+ break
+ end
+ end
+ end
if vs_runtime and ld and path.basename(ld:lower()) == "link" then -- for msvc?
configs.cxflags = table.wrap(configs.cxflags)
table.insert(configs.cxflags, "/" .. vs_runtime)