summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2022-09-13 23:06:01 (GMT)
committerGitHub <noreply@github.com>2022-09-13 23:06:01 (GMT)
commit851ef4b23c7cbf4ceb2ba1099666a8b5ec4fa195 (patch)
treec6f90340fa1644ca669bd9a3a29a6716640677a1
parent72b9348f023479b7d9afb4b7c2c8a666e82ff7a8 (diff)
parent5ccbd38277989ae6a728171d59ae03bad6f2f4d5 (diff)
downloadlz4-851ef4b23c7cbf4ceb2ba1099666a8b5ec4fa195.zip
lz4-851ef4b23c7cbf4ceb2ba1099666a8b5ec4fa195.tar.gz
lz4-851ef4b23c7cbf4ceb2ba1099666a8b5ec4fa195.tar.bz2
Merge pull request #1162 from foxeng/fix-static-only
build: Support BUILD_SHARED=no
-rw-r--r--lib/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 06503cb..ee262c0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -112,17 +112,21 @@ liblz4-dll.o: liblz4-dll.rc
$(WINDRES) -i liblz4-dll.rc -o liblz4-dll.o
$(LIBLZ4): $(SRCFILES) liblz4-dll.o
+ifeq ($(BUILD_SHARED),yes)
@echo compiling dynamic library $(LIBVER)
$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll/$@.dll -Wl,--out-implib,dll/$(LIBLZ4_EXP)
+endif
else # not windows
$(LIBLZ4): $(SRCFILES)
+ifeq ($(BUILD_SHARED),yes)
@echo compiling dynamic library $(LIBVER)
$(CC) $(FLAGS) -shared $^ -fPIC -fvisibility=hidden $(SONAME_FLAGS) -o $@
@echo creating versioned links
$(LN_SF) $@ liblz4.$(SHARED_EXT_MAJOR)
$(LN_SF) $@ liblz4.$(SHARED_EXT)
+endif
endif