diff options
| author | ruki <[email protected]> | 2024-07-20 08:08:57 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-20 08:08:57 +0800 |
| commit | 84d48dc86db6f0968232ce3b9bc2df808f89d046 (patch) | |
| tree | d1da88434e1e71870e9b1d61c29881cbc5c9b48d | |
| parent | 87308fe638fc9a7da3e8d90e40a375f7ca562136 (diff) | |
| parent | b94cb84a5f6bb49e933618a7a1394a057257047c (diff) | |
Merge pull request #5365 from xmake-io/cmake
Improve cmake.install for ninja
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index d2fa362c6..fdbf7bb73 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -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}) @@ -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}) |
