diff options
author | Ferdinand Bachmann | 2021-04-06 15:00:10 +0200 |
---|---|---|
committer | Ferdinand Bachmann | 2021-04-06 15:23:19 +0200 |
commit | 4809fa9acd994084bccef58153d5360f28a0ce83 (patch) | |
tree | 8de2f3f54067c980c8ab0ce432b6db07c5b041bb /PKGBUILD | |
parent | 083c1a024d6f1e61947e0bb1892a42ed8ca9c5f5 (diff) | |
download | aur-4809fa9acd994084bccef58153d5360f28a0ce83.tar.gz |
remove compilation flags incompatible with clang before building
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -46,7 +46,41 @@ prepare() { patch -Np1 -i ../wit-titles.patch } +_not() { + if "$@"; then + return 1 + else + return 0 + fi +} + +_array_contains() { + local haystack="$1[@]" + local needle="$2" + + for value in "${!haystack}"; do + if [[ "$value" == "$needle" ]]; then + return 0 + fi + done + + return 1 +} + +_incompatible_flags=( "-fvar-tracking-assignments" ) +_clang_remove_incompatible_flags() { + local newflags= + for flag in $CFLAGS; do + if _not _array_contains _incompatible_flags "$flag"; then + newflags="$newflags $flag" + fi + done + + export CFLAGS="$newflags" +} + build() { + _clang_remove_incompatible_flags make INSTALL_PATH="${pkgdir}/usr" CC=clang -C wiimms-iso-tools/project tools make INSTALL_PATH="${pkgdir}/usr" CC=clang -C wiimms-iso-tools/project doc } |