Skip to content

Commit

Permalink
Merge pull request #5365 from xmake-io/cmake
Browse files Browse the repository at this point in the history
Improve cmake.install for ninja
  • Loading branch information
waruqi authored Jul 20, 2024
2 parents 87308fe + b94cb84 commit 84d48dc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions xmake/modules/package/tools/cmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,14 @@ end
-- do build for ninja
function _build_for_ninja(package, configs, opt)
opt = opt or {}
-- Fix pdb issue, if multiple CL.EXE write to the same .PDB file, please use /FS
-- @see https://github.com/xmake-io/xmake/issues/5353
if package:is_plat("windows") and package:has_tool("cxx", "cl") then
local pdbdir = "pdb"
if not os.isdir(pdbdir) then
os.mkdir(pdbdir)
end
end
ninja.build(package, {}, {envs = opt.envs or buildenvs(package, opt),
jobs = opt.jobs,
target = opt.target})
Expand Down Expand Up @@ -1063,6 +1071,14 @@ end
-- do install for ninja
function _install_for_ninja(package, configs, opt)
opt = opt or {}
-- Fix pdb issue, if multiple CL.EXE write to the same .PDB file, please use /FS
-- @see https://github.com/xmake-io/xmake/issues/5353
if package:is_plat("windows") and package:has_tool("cxx", "cl") then
local pdbdir = "pdb"
if not os.isdir(pdbdir) then
os.mkdir(pdbdir)
end
end
ninja.install(package, {}, {envs = opt.envs or buildenvs(package, opt),
jobs = opt.jobs,
target = opt.target})
Expand Down

0 comments on commit 84d48dc

Please sign in to comment.