diff options
| -rw-r--r-- | xmake/core/package/package.lua | 10 |
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) |
