dart icon indicating copy to clipboard operation
dart copied to clipboard

Support BUILD_SHARED_LIBS set to ON on Windows/MSVC

Open traversaro opened this issue 5 years ago • 2 comments

Is your feature request related to a problem? Please describe. Given its huge size, for some applications it is convenient to be able to compiled dart as a shared library on Windows/MSVC, to permit to share it among multiple executable.

Additional context Discussion on this was ongoing on https://github.com/dartsim/dart/issues/1005, but that issue was closed as its main objective was reached without the need to make sure that DART supported being compiled as a shared library on Windows.

traversaro avatar Sep 17 '20 10:09 traversaro

Do you know what's preventing us from building DART as shared libraries? Doesn't BUILD_SHARED_LIBS work as it is?

jslee02 avatar Sep 18 '20 02:09 jslee02

To be honest I did not tried myself, but from https://github.com/dartsim/dart/issues/1005 it seems that the situation is the following:

  • The CMake variable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not work as the library has more then 65k symbols, see https://github.com/dartsim/dart/issues/1005#issuecomment-375144278 .
  • An attempt was made in https://github.com/dartsim/dart/pull/1040 to add explicit visibility macros, but i guess there were some problem/doubts on where to add visibility macros for heavily templated class, and then eventually the PR was not completed.

traversaro avatar Sep 18 '20 06:09 traversaro

Fixed by d78c3286ee371fe544f93bc2c2040d550da18685

jslee02 avatar Jan 14 '23 07:01 jslee02

Great, thanks a lot!

traversaro avatar Jan 14 '23 07:01 traversaro

Thanks for being patient with this. I had to implement some workarounds and make adjustments to the code to get it working. I will be addressing these issues and making improvements in future commits.

jslee02 avatar Jan 14 '23 07:01 jslee02