eclipse-cyclonedds / cyclonedds-cxx

Other
95 stars 75 forks source link

Support building cyclonedds-cxx statically #388

Open AlgoryxJosef opened 1 year ago

AlgoryxJosef commented 1 year ago

Earlier last year (I think that was when), changes to the CycloneDDS C library was made to support building it into a static libarry. On Windows, getting only a .lib file that then can be linked to, statically, from a third party application.

Trying to build cyclonedds-cxx statically on Windows as least seams to fail.

Using -DBUILD_SHARED_LIBS=OFF when running Cmake works OK (Cmake gives no warnings), but when building the whole solution, the examples are giving link errors.

Building without the examples and then trying to link statically from a third party application yields the same link errors.

It would be really nice if this was supported out-of-the-box. Adding the support may not be more work than a few lines of Cmake code, from anyone with the knowledge of where to look.

It should also be checked that it is possible to link statically the C-libary from Cyclonedds-cxx.

jkav77 commented 2 months ago

I also get linker errors after statically linking CycloneDDS-CXX on x86_64 linux.