mirror of
https://github.com/facebook/zstd.git
synced 2025-10-16 00:04:24 -04:00
Merge pull request #666 from iburinoc/zstdmt-default
Add MT enabled targets for libzstd
This commit is contained in:
commit
987cc95ed7
12
lib/Makefile
12
lib/Makefile
@ -71,6 +71,9 @@ libzstd.a: $(ZSTD_OBJ)
|
||||
@echo compiling static library
|
||||
@$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
libzstd.a-mt: CPPFLAGS += -DZSTD_MULTHREAD
|
||||
libzstd.a-mt: libzstd.a
|
||||
|
||||
$(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
|
||||
$(LIBZSTD): $(ZSTD_FILES)
|
||||
@echo compiling dynamic library $(LIBVER)
|
||||
@ -86,10 +89,17 @@ endif
|
||||
|
||||
libzstd : $(LIBZSTD)
|
||||
|
||||
libzstd-mt : CPPFLAGS += -DZSTD_MULTITHREAD
|
||||
libzstd-mt : libzstd
|
||||
|
||||
lib: libzstd.a libzstd
|
||||
|
||||
lib-release: DEBUGFLAGS :=
|
||||
lib-mt: CPPFLAGS += -DZSTD_MULTITHREAD
|
||||
lib-mt: lib
|
||||
|
||||
lib-release lib-release-mt: DEBUGFLAGS :=
|
||||
lib-release: lib
|
||||
lib-release-mt: lib-mt
|
||||
|
||||
clean:
|
||||
@$(RM) -r *.dSYM # Mac OS-X specific
|
||||
|
@ -22,6 +22,14 @@ Some additional API may be useful if you're looking into advanced features :
|
||||
They are not "stable", their definition may change in the future.
|
||||
Only static linking is allowed.
|
||||
|
||||
#### ZSTDMT API
|
||||
|
||||
To enable building the multithreaded compression API, use the `make lib-mt` target.
|
||||
The header file zstdmt_compress.h (in compress/) provides the prototypes for the API.
|
||||
If linking a program that uses the ZSTDMT API against libzstd.a on a POSIX system,
|
||||
the -pthread flag must be provided to the compiler at link time.
|
||||
Note that these prototypes may still be used in a version built without multithread support,
|
||||
but they will be single threaded (i.e. no benefits will be given over the standard ZSTD API).
|
||||
|
||||
#### Modular build
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user