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.
This commit is contained in:
Martin Storsjö 2014-02-19 11:51:50 +02:00
parent 42fb4f562e
commit b1d8671bd4
3 changed files with 9 additions and 1 deletions

View File

@ -123,7 +123,7 @@ $(LIBPREFIX)wels.$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS
$(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

View File

@ -13,3 +13,6 @@ LINK_LIB=$(1).lib
LIBSUFFIX=lib
LIBPREFIX=
EXEEXT=.exe
SHAREDLIBSUFFIX=dll
SHARED=-LD
SHLDFLAGS=-link -def:wels.def -implib:wels_dll.lib

5
wels.def Normal file
View File

@ -0,0 +1,5 @@
EXPORTS
CreateDecoder
DestroyDecoder
CreateSVCEncoder
DestroySVCEncoder