aboutsummarylogtreecommitdiffstats
path: root/mold.sh.in
blob: 869534501cb58944ce0f5af447ae085055e61064 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/bash
#
#   mold.sh - Compile with the fast mold linker
#

[[ -n "$LIBMAKEPKG_BUILDENV_MOLD_SH" ]] && return
LIBMAKEPKG_BUILDENV_MOLD_SH=1

LIBRARY=${LIBRARY:-'@libmakepkgdir@'}

source "$LIBRARY/util/option.sh"

build_options+=('mold')
buildenv_functions+=('buildenv_mold')

buildenv_mold() {
  if check_buildoption "mold" "y"; then
    moldflags=" -fuse-ld=mold"
    CFLAGS+="$moldflags"
    CFLAGS+="$moldflags"
    CLAGS+="$moldflags"
  fi
}