ref: b1d8671bd43fd58e99aa341c0242edddf60971a1
parent: 42fb4f562e0148b61ace9ce3733638e4fbbe0c53
author: Martin Storsjö <[email protected]>
date: Wed Feb 19 06:51:50 EST 2014
Support building DLLs with MSVC MSVC doesn't export any functions at all by default, contrary to gcc which exports all global functions by default. Doing the same for linux/OS X isn't too hard, but they use yet two other, different syntaxes for the corresponding symbol file.
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@
$(LIBPREFIX)wels.$(SHAREDLIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
$(QUIET)rm -f $@
- $(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+
+ $(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(SHLDFLAGS)
install: $(LIBPREFIX)wels.$(LIBSUFFIX) $(LIBPREFIX)wels.$(SHAREDLIBSUFFIX)
mkdir -p $(PREFIX)/lib
--- a/build/platform-msvc-common.mk
+++ b/build/platform-msvc-common.mk
@@ -13,3 +13,6 @@
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
+SHAREDLIBSUFFIX=dll
+SHARED=-LD
+SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib
--- /dev/null
+++ b/wels.def
@@ -1,0 +1,5 @@
+EXPORTS
+ CreateDecoder
+ DestroyDecoder
+ CreateSVCEncoder
+ DestroySVCEncoder