chore(build): use mold linker instead of lld if available
This commit is contained in:
parent
7017901dec
commit
b2a5649290
3 changed files with 19 additions and 19 deletions
|
|
@ -8,7 +8,7 @@ To compile, a stable Rust compiler and [just](https://github.com/casey/just) are
|
||||||
|
|
||||||
- cargo
|
- cargo
|
||||||
- just
|
- just
|
||||||
- lld
|
- mold
|
||||||
|
|
||||||
Some C libraries are also required for font support at the moment.
|
Some C libraries are also required for font support at the moment.
|
||||||
|
|
||||||
|
|
|
||||||
14
debian/control
vendored
14
debian/control
vendored
|
|
@ -4,18 +4,18 @@ Priority: optional
|
||||||
Maintainer: Michael Murphy <mmstick@pm.me>
|
Maintainer: Michael Murphy <mmstick@pm.me>
|
||||||
Build-Depends:
|
Build-Depends:
|
||||||
debhelper-compat (=13),
|
debhelper-compat (=13),
|
||||||
just (>= 1.13.0),
|
|
||||||
rust-all,
|
|
||||||
cmake,
|
cmake,
|
||||||
|
just (>= 1.13.0),
|
||||||
libexpat1-dev,
|
libexpat1-dev,
|
||||||
libfontconfig-dev,
|
libfontconfig-dev,
|
||||||
libfreetype-dev,
|
libfreetype-dev,
|
||||||
lld,
|
libinput-dev,
|
||||||
libwayland-dev,
|
|
||||||
pkg-config,
|
|
||||||
libxkbcommon-dev,
|
|
||||||
libudev-dev,
|
libudev-dev,
|
||||||
libinput-dev
|
libwayland-dev,
|
||||||
|
libxkbcommon-dev,
|
||||||
|
mold,
|
||||||
|
pkg-config,
|
||||||
|
rust-all,
|
||||||
Standards-Version: 4.6.2
|
Standards-Version: 4.6.2
|
||||||
Homepage: https://github.com/pop-os/cosmic-settings
|
Homepage: https://github.com/pop-os/cosmic-settings
|
||||||
|
|
||||||
|
|
|
||||||
22
justfile
22
justfile
|
|
@ -1,21 +1,21 @@
|
||||||
name := 'cosmic-settings'
|
name := 'cosmic-settings'
|
||||||
appid := 'com.system76.CosmicSettings'
|
appid := 'com.system76.CosmicSettings'
|
||||||
|
|
||||||
# Use lld linker if available
|
# Use mold linker if clang and mold exists.
|
||||||
ld-args := if `which lld || true` != '' {
|
clang-path := `which clang || true`
|
||||||
'-C link-arg=-fuse-ld=lld -C link-arg=-Wl,--build-id=sha1'
|
mold-path := `which mold || true`
|
||||||
|
|
||||||
|
linker-arg := if clang-path != '' {
|
||||||
|
if mold-path != '' {
|
||||||
|
'-C linker=' + clang-path + ' -C link-arg=--ld-path=' + mold-path + ' '
|
||||||
|
} else {
|
||||||
|
''
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
''
|
''
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use the x86-64-v2 target by default on x86-64 systems.
|
export RUSTFLAGS := linker-arg + env_var_or_default('RUSTFLAGS', '')
|
||||||
target-cpu := if arch() == 'x86_64' { 'x86-64-v2' } else { '' }
|
|
||||||
|
|
||||||
export RUSTFLAGS := if target-cpu != '' {
|
|
||||||
ld-args + ' -C target-cpu=' + target-cpu + ' ' + env_var_or_default('RUSTFLAGS', '')
|
|
||||||
} else {
|
|
||||||
ld-args + ' ' + env_var_or_default('RUSTFLAGS', '')
|
|
||||||
}
|
|
||||||
|
|
||||||
rootdir := ''
|
rootdir := ''
|
||||||
prefix := '/usr'
|
prefix := '/usr'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue