Skip to content

Commit

Permalink
fix runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Apr 21, 2024
1 parent 0ec4f8b commit 561e779
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions xmake/modules/package/tools/cmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function _get_cxxflags(package, opt)
end
local runtimes = package:runtimes()
if runtimes then
local fake_target = {is_shared = function(_) return false end,
local fake_target = {is_shared = function(_) return false end,
sourcekinds = function(_) return "cxx" end}
table.join2(result, _map_compflags(fake_target, "cxx", "runtime", runtimes))
end
Expand Down Expand Up @@ -239,9 +239,9 @@ function _get_ldflags(package, opt)
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "syslink", package:build_getenv("syslinks")))
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "linkdir", package:build_getenv("linkdirs")))
end
local runtimes = package:config("runtimes")
local runtimes = package:runtimes()
if runtimes then
local fake_target = {is_shared = function(_) return false end,
local fake_target = {is_shared = function(_) return false end,
sourcekinds = function(_) return "cxx" end}
table.join2(result, _map_linkflags(fake_target, "binary", {"cxx"}, "runtime", runtimes))
end
Expand Down Expand Up @@ -271,9 +271,9 @@ function _get_shflags(package, opt)
table.join2(result, _map_linkflags(package, "shared", {"cxx"}, "syslink", package:build_getenv("syslinks")))
table.join2(result, _map_linkflags(package, "shared", {"cxx"}, "linkdir", package:build_getenv("linkdirs")))
end
local runtimes = package:config("runtimes")
local runtimes = package:runtimes()
if runtimes then
local fake_target = {is_shared = function(_) return true end,
local fake_target = {is_shared = function(_) return true end,
sourcekinds = function(_) return "cxx" end}
table.join2(result, _map_linkflags(fake_target, "shared", {"cxx"}, "runtime", runtimes))
end
Expand Down
6 changes: 3 additions & 3 deletions xmake/modules/package/tools/meson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ function _get_configs_file(package, opt)
-- add runtimes flags
for _, runtime in ipairs(package:runtimes()) do
if not runtime:startswith("M") then
local fake_target = {is_shared = function(_) return false end,
local fake_target = {is_shared = function(_) return false end,
sourcekinds = function(_) return "cxx" end}
table.join2(cxxflags, _map_compflags(fake_target, "cxx", "runtime", {runtime}))
table.join2(ldflags, _map_linkflags(fake_target, "binary", {"cxx"}, "runtime", {runtime}))
fake_target = {is_shared = function(_) return true end,
fake_target = {is_shared = function(_) return true end,
sourcekinds = function(_) return "cxx" end}
table.join2(shflags, _map_linkflags(fake_target, "shared", {"cxx"}, "runtime", {runtime}))
end
Expand Down Expand Up @@ -347,7 +347,7 @@ function _get_configs(package, configs, opt)
end

-- add vs runtimes flags
if package:has_runtime("MT*", "MD*") then
if package:is_plat("windows") then
if package:has_runtime("MT") then
table.insert(configs, "-Db_vscrt=mt")
elseif package:has_runtime("MTd") then
Expand Down

0 comments on commit 561e779

Please sign in to comment.