mirror of
https://github.com/shadps4-emu/ext-libusb.git
synced 2026-01-31 00:55:21 +01:00
CI: Enable Address Sanitizer (ASAN) where supported
GCC on MSYS2 doesn't have ASAN support. And do not enable it for MSVC "Release" target.
This commit is contained in:
committed by
Tormod Volden
parent
e28fa3069a
commit
c0057c3942
3
.github/workflows/msys2.yml
vendored
3
.github/workflows/msys2.yml
vendored
@@ -18,4 +18,5 @@ jobs:
|
||||
run: |
|
||||
echo 'Running in MSYS2!'
|
||||
./bootstrap.sh
|
||||
./.private/ci-build.sh --build-dir build-msys2
|
||||
# GCC on MSYS2 doesn't have ASAN support (but Clang does).
|
||||
./.private/ci-build.sh --build-dir build-msys2 --no-asan
|
||||
|
||||
@@ -19,4 +19,8 @@ echo "Bootstrapping ..."
|
||||
./bootstrap.sh
|
||||
echo ""
|
||||
|
||||
exec .private/ci-build.sh --build-dir "${builddir}" --install -- "--prefix=${installdir}"
|
||||
extra_args=""
|
||||
if [ "${Configuration}" == "Release" ]; then
|
||||
extra_args="--no-asan"
|
||||
fi
|
||||
exec .private/ci-build.sh --build-dir "${builddir}" --install ${extra_args} -- "--prefix=${installdir}"
|
||||
|
||||
@@ -5,6 +5,7 @@ set -e
|
||||
builddir=
|
||||
install=no
|
||||
test=yes
|
||||
asan=yes
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
@@ -24,6 +25,10 @@ while [ $# -gt 0 ]; do
|
||||
test=no
|
||||
shift
|
||||
;;
|
||||
--no-asan)
|
||||
asan=no
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break;
|
||||
@@ -57,6 +62,11 @@ cflags+=" -Wpointer-arith"
|
||||
cflags+=" -Wredundant-decls"
|
||||
cflags+=" -Wswitch-enum"
|
||||
|
||||
# enable address sanitizer
|
||||
if [ "${asan}" = "yes" ]; then
|
||||
cflags+=" -fsanitize=address"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Configuring ..."
|
||||
CFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@"
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 11822
|
||||
#define LIBUSB_NANO 11823
|
||||
|
||||
Reference in New Issue
Block a user