[
https://issues.apache.org/jira/browse/THRIFT-1834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596130#comment-16596130
]
Mario Emmenlauer commented on THRIFT-1834:
------------------------------------------
I agree that the endgame is quite some work. But maybe its possible to be
pragmatic and start with a best effort. Here is an approach that would bring
the full feature set with moderate effort: For a start, I would use the cmake
builtin functionality to export all symbols from the dll automatically
([https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html).]
This is slightly hackish, but it will just bring the typical behavior on Un*x
to the Windows dll, so I think it can be an acceptable start. I've used this
successfully in the past to port a number of libraries and there are rarely any
problems.
When thrift can be built as shared library, I would focus on the thrift
compiler to generate code that correctly exports the symbols. This may be
almost trivial or a bit more effort depending what symbols are generated(?) I
do not feel super comfortable to do this change myself.
With these two changes in place, the functionality may be good enough for a
large group of users. Its not super clean to export all symbols from
thrift.dll, but at the same time its not a real problem. Over time, more and
more symbols can get the actual correct export definitions, so that eventually
the WINDOWS_EXPORT_ALL_SYMBOLS can go away.
Would that be reasonable?
> As a developer, I would like a thrift C++ runtime DLL for windows development
> -----------------------------------------------------------------------------
>
> Key: THRIFT-1834
> URL: https://issues.apache.org/jira/browse/THRIFT-1834
> Project: Thrift
> Issue Type: Story
> Components: C++ - Library
> Affects Versions: 0.9
> Environment: Windows x86_64 MSVC 2010
> Reporter: Chris Stylianou
> Priority: Major
> Labels: dll, msvc, thrift, windows
>
> I am unable to build a valid .dll version of the Thrift C++ library using
> MSVC2010 as nothing has been declared with
> "__declspec(dllexport)/__declspec(dllimport)", meaning that MSVC2010 (and
> presumably all other versions) are unable to generate the import .lib that
> should accompany the .dll library.
> Currently the cmake environment only supports building a static library (with
> static or dynamic runtime - you choose with the "WITH_MT" option).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)