ref: d8e318e0a441b1fca46c59daf99b77697691f2b8
parent: 0a73155bdd4baeace8fe1514683aa4bfbf0f2382
parent: 561027ebacd7cd28e1a22073fd7196ab99ce5d6e
author: Ethan Hugg <[email protected]>
date: Wed Feb 19 06:12:41 EST 2014
Merge pull request #313 from mstorsjo/fix-msvc-build Fix msvc build
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
BUILDTYPE=Release
V=Yes
PREFIX=/usr/local
+SHARED=-shared
ifeq (,$(wildcard ./gtest))
HAVE_GTEST=No
@@ -121,16 +122,17 @@
$(QUIET_AR)$(AR) $(AR_OPTS) $+
$(LIBPREFIX)wels.$(SHAREDLIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
- rm -f $@
- @echo
- @echo $+
- @echo
- $(CXX) -shared $(LDFLAGS) -o $@ $+
+ $(QUIET)rm -f $@
+ $(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(SHLDFLAGS)
-install: $(LIBPREFIX)wels.$(LIBSUFFIX)
+install: $(LIBPREFIX)wels.$(LIBSUFFIX) $(LIBPREFIX)wels.$(SHAREDLIBSUFFIX)
mkdir -p $(PREFIX)/lib
mkdir -p $(PREFIX)/include/wels
install -m 644 $(LIBPREFIX)wels.$(LIBSUFFIX) $(PREFIX)/lib
+ install -m 755 $(LIBPREFIX)wels.$(SHAREDLIBSUFFIX) $(PREFIX)/lib
+ifneq ($(EXTRA_LIBRARY),)
+ install -m 644 $(EXTRA_LIBRARY) $(PREFIX)/lib
+endif
install -m 644 codec/api/svc/codec*.h $(PREFIX)/include/wels
ifeq ($(HAVE_GTEST),Yes)
--- a/build/platform-msvc-common.mk
+++ b/build/platform-msvc-common.mk
@@ -13,3 +13,7 @@
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
+SHAREDLIBSUFFIX=dll
+SHARED=-LD
+SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
+EXTRA_LIBRARY=wels_dll.lib
--- a/build/platform-msvc.mk
+++ b/build/platform-msvc.mk
@@ -1,3 +1,4 @@
+include build/platform-x86-common.mk
include build/platform-msvc-common.mk
ASM = nasm
CFLAGS += -DMT_ENABLED
--- /dev/null
+++ b/wels.def
@@ -1,0 +1,5 @@
+EXPORTS
+ CreateDecoder
+ DestroyDecoder
+ CreateSVCEncoder
+ DestroySVCEncoder