Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meson cross build on windows #4990

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions xmake/modules/package/tools/meson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,28 @@ function _get_configs_file(package, opt)
if cc then
file:print("c=['%s']", executable_path(cc))
end

local cxx = package:build_getenv("cxx")
-- https://github.com/xmake-io/xmake/discussions/4979
if cxx and package:has_tool("cxx", "clang", "gcc") then
local dir = path.directory(cxx)
local name = path.filename(cxx)
name = name:gsub("clang$", "clang++")
name = name:gsub("clang%-", "clang++-") -- clang-xx
name = name:gsub("clang%.", "clang++.") -- clang.exe
name = name:gsub("gcc$", "g++")
name = name:gsub("gcc%-", "g++-")
name = name:gsub("gcc%.", "g++.")
if dir and dir ~= "." then
cxx = path.join(dir, name)
else
cxx = name
if cxx then
-- https://github.com/xmake-io/xmake/discussions/4979
if package:has_tool("cxx", "clang", "gcc") then
local dir = path.directory(cxx)
local name = path.filename(cxx)
name = name:gsub("clang$", "clang++")
name = name:gsub("clang%-", "clang++-") -- clang-xx
name = name:gsub("clang%.", "clang++.") -- clang.exe
name = name:gsub("gcc$", "g++")
name = name:gsub("gcc%-", "g++-")
name = name:gsub("gcc%.", "g++.")
if dir and dir ~= "." then
cxx = path.join(dir, name)
else
cxx = name
end
end
file:print("cpp=['%s']", executable_path(cxx))
end

local ld = package:build_getenv("ld")
if ld then
file:print("ld=['%s']", executable_path(ld))
Expand Down
Loading