From b1d8671bd43fd58e99aa341c0242edddf60971a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 19 Feb 2014 11:51:50 +0200 Subject: [PATCH] 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. --- Makefile | 2 +- build/platform-msvc-common.mk | 3 +++ wels.def | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 wels.def diff --git a/Makefile b/Makefile index 5b7dfce4..3c2ffb5c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build/platform-msvc-common.mk b/build/platform-msvc-common.mk index 3c89ba74..13a57998 100644 --- a/build/platform-msvc-common.mk +++ b/build/platform-msvc-common.mk @@ -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 diff --git a/wels.def b/wels.def new file mode 100644 index 00000000..281246f0 --- /dev/null +++ b/wels.def @@ -0,0 +1,5 @@ +EXPORTS + CreateDecoder + DestroyDecoder + CreateSVCEncoder + DestroySVCEncoder