Skip to content

Commit

Permalink
tests: Use AM_LDFLAGS for -static flag
Browse files Browse the repository at this point in the history
tests/Makefile.am:3: warning: 'LDFLAGS' is a user variable, you should not override it;
tests/Makefile.am:3: use 'AM_LDFLAGS' instead

Signed-off-by: Tormod Volden <[email protected]>
  • Loading branch information
tormodvolden committed Dec 10, 2023
1 parent 43db4d9 commit 1273585
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)/libusb
LDADD = ../libusb/libusb-1.0.la
LDFLAGS = -static
AM_LDFLAGS = -static

stress_SOURCES = stress.c testlib.c
stress_mt_SOURCES = stress_mt.c
Expand All @@ -10,13 +10,14 @@ macos_SOURCES = macos.c testlib.c

stress_mt_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
stress_mt_LDADD = $(LDADD) $(THREAD_LIBS)
stress_mt_LDFLAGS = $(AM_LDFLAGS)

if OS_EMSCRIPTEN
# On the Web you can't block the main thread as this blocks the event loop itself,
# causing deadlocks when trying to use async APIs like WebUSB.
# We use the PROXY_TO_PTHREAD Emscripten's feature to move the main app to a separate thread
# where it can block safely.
stress_mt_LDFLAGS = ${AM_LDFLAGS} -s PROXY_TO_PTHREAD -s EXIT_RUNTIME
stress_mt_LDFLAGS += ${AM_LDFLAGS} -s PROXY_TO_PTHREAD -s EXIT_RUNTIME
endif

noinst_HEADERS = libusb_testlib.h
Expand Down

0 comments on commit 1273585

Please sign in to comment.