Skip to content
Permalink
Browse files

Use && instead of test -a

POSIX does not specify test for > 4 arguments:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
  • Loading branch information...
hirschsn committed Nov 4, 2019
1 parent 30b25a2 commit 0684d17d6b73e648e572fdba191f3c4fe8e1b29b
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/python/pypresso.cmakein
@@ -14,13 +14,13 @@ else
fi
export PYTHONPATH

if [ "@CMAKE_CXX_COMPILER_ID@" != "GNU" -a "@WITH_ASAN@" = "ON" ]; then
if [ "@CMAKE_CXX_COMPILER_ID@" != "GNU" ] && [ "@WITH_ASAN@" = "ON" ]; then
asan_lib=$("@CMAKE_CXX_COMPILER@" /dev/null -### -o /dev/null -fsanitize=address 2>&1 | grep -o '[" ][^" ]*libclang_rt.asan[^" ]*[^s][" ]' | sed 's/[" ]//g' | sed 's/\.a$/.so/g')
for lib in $asan_lib; do
test -f $lib && LD_PRELOAD="$lib $LD_PRELOAD"
done
fi
if [ "@CMAKE_CXX_COMPILER_ID@" != "GNU" -a "@WITH_UBSAN@" = "ON" -a "@WITH_ASAN@" != "ON" ]; then
if [ "@CMAKE_CXX_COMPILER_ID@" != "GNU" ] && [ "@WITH_UBSAN@" = "ON" ] && [ "@WITH_ASAN@" != "ON" ]; then
ubsan_lib=$("@CMAKE_CXX_COMPILER@" /dev/null -### -o /dev/null -fsanitize=undefined 2>&1 | grep -o '[" ][^" ]*libclang_rt.ubsan[^" ]*[^s][" ]' | sed 's/[" ]//g' | sed 's/\.a$/.so/g')
for lib in $ubsan_lib; do
test -f $lib && LD_PRELOAD="$lib $LD_PRELOAD"
@@ -47,7 +47,7 @@ if [ "@WITH_ASAN@" = "ON" ]; then
fi
export ASAN_OPTIONS
fi
if [ "@WITH_MSAN@" = "ON" -a "@WARNINGS_ARE_ERRORS@" = "ON" ]; then
if [ "@WITH_MSAN@" = "ON" ] && [ "@WARNINGS_ARE_ERRORS@" = "ON" ]; then
export MSAN_OPTIONS="halt_on_error=1 $MSAN_OPTIONS"
fi

0 comments on commit 0684d17

Please sign in to comment.
You can’t perform that action at this time.