]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
seekable_format: Link against multi-threaded libzstd.a
authorDave Vasilevsky <dave@vasilevsky.ca>
Wed, 7 May 2025 01:57:29 +0000 (21:57 -0400)
committerYann Collet <Cyan4973@users.noreply.github.com>
Thu, 8 May 2025 05:01:49 +0000 (22:01 -0700)
Some of these examples are intended to be parallel, and don't make
sense to link against single-threaded libzstd.

The filename of mt and nomt libzstd are identical, so it's still
possible to link against the single-threaded one, just harder.

contrib/seekable_format/examples/Makefile

index 336d8c722475fddbee75103a3bd828de09cd30db..f15a4a15a8044573daef4a178646441515f95c64 100644 (file)
@@ -11,6 +11,8 @@
 
 ZSTDLIB_PATH = ../../../lib
 ZSTDLIB_NAME = libzstd.a
+# Parallel tools only make sense against multi-threaded libzstd
+ZSTDLIB_TARGET = $(ZSTDLIB_NAME)-mt
 ZSTDLIB = $(ZSTDLIB_PATH)/$(ZSTDLIB_NAME)
 
 CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ -I../ -I../../../lib -I../../../lib/common
@@ -28,7 +30,7 @@ all: seekable_compression seekable_decompression seekable_decompression_mem \
        parallel_processing
 
 $(ZSTDLIB):
-       $(MAKE) -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME)
+       $(MAKE) -C $(ZSTDLIB_PATH) $(ZSTDLIB_TARGET)
 
 seekable_compression : seekable_compression.c $(SEEKABLE_OBJS)
        $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@