On Windows (I'm using MSVC v143 if this information is relevant), if set the cmake option BUILD_SHARED_LIBS to OFF, then the compilation would fail. The errors look like this:
After some debugging, I found the root cause is this macro block in RBDyn
and this macro block in RBDynParsers
are both NOT properly activated even if BUILD_SHARED_LIBS=OFF, because the macro RBDYN_STATIC and RBDYN_PARSERS_STATIC are never defined in cmake. This caused the __declspec(dllimport) Windows shared library directive to be appended in the compiled static library RBDyn.lib and RBDynParsers.lib, which caused the linker errors.
Making the following changes solved the issue, please review and PR the fix, thanks.
On Windows (I'm using MSVC v143 if this information is relevant), if set the cmake option BUILD_SHARED_LIBS to OFF, then the compilation would fail. The errors look like this:
After some debugging, I found the root cause is this macro block in RBDyn and this macro block in RBDynParsers are both NOT properly activated even if BUILD_SHARED_LIBS=OFF, because the macro
RBDYN_STATIC
andRBDYN_PARSERS_STATIC
are never defined in cmake. This caused the__declspec(dllimport)
Windows shared library directive to be appended in the compiled static library RBDyn.lib and RBDynParsers.lib, which caused the linker errors.Making the following changes solved the issue, please review and PR the fix, thanks.