mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-13 05:22:08 +01:00
set codegen units properly in cargo config
This commit is contained in:
parent
0c3ce3d22e
commit
e40f93fd5f
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
<! local ncpus = tonumber(opt.system "nproc") !>
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
linker = "/usr/bin/clang"
|
||||
rustflags = ["-Clink-arg=-fuse-ld=lld"]
|
||||
|
@ -5,4 +6,7 @@ rustflags = ["-Clink-arg=-fuse-ld=lld"]
|
|||
[profile.release]
|
||||
lto = true
|
||||
opt-level = 3
|
||||
codegen-units = 1
|
||||
codegen-units = <% math.min(ncpus, 4) %>
|
||||
|
||||
[profile.debug]
|
||||
codegen-units = <% ncpus %>
|
|
@ -57,7 +57,8 @@ cg.opt.system = function(cmd)
|
|||
if handle == nil then
|
||||
error("Failed to spawn process" .. cmd)
|
||||
end
|
||||
return handle:read("*a"):gsub("%s+", "")
|
||||
local data, _ = handle:read("*a"):gsub("%s$", "")
|
||||
return data
|
||||
end
|
||||
|
||||
-- Compile the input as lua. Meant to be used as a post-processor.
|
||||
|
|
Loading…
Reference in a new issue