Merge pull request #56661 from matthewbauer/stack-hook-fixup

stack-hook: deduplicate better
This commit is contained in:
Matthew Bauer 2019-03-09 18:08:47 -05:00 committed by GitHub
commit ca6e93155b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,11 @@
addStackArgs () {
if [ -d "$1/lib" ] && [[ "$STACK_IN_NIX_EXTRA_ARGS" != *"--extra-lib-dirs=$1/lib"* ]]; then
if [ -n "$(echo $1/lib/lib*)" ]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-lib-dirs=$1/lib"
fi
if [ -d "$1/include" ] && [[ "$STACK_IN_NIX_EXTRA_ARGS" != *"--extra-include-dirs=$1/include"* ]]; then
if [ -d "$1/include" ]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-include-dirs=$1/include"
fi
}
addEnvHooks "$hostOffset" addStackArgs
addEnvHooks "$targetOffset" addStackArgs