sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
107 stars 63 forks source link

CMake: add object libraries to the export set for static builds #139

Closed tstenner closed 2 years ago

tstenner commented 2 years ago

For shared builds, the linker combines all object files and CMake discards the private properties of the lslboost and lslobj targets. For shared libraries, it just combines the object files and adds references to the interface properties of the two object libraries, so they need to be imported.

Copying the properties manually is messy and error-prone, so this PR adds the two object libraries to the export this. Hopefully fixes #138.

tstenner commented 2 years ago

Paging @chausner

cboulay commented 2 years ago

Also need to add -DLSL_BUILD_STATIC=ON to CI scripts.

chausner commented 2 years ago

Yes, this seems to fix the issue, thanks! 👍

tstenner commented 2 years ago

Also need to add -DLSL_BUILD_STATIC=ON to CI scripts.

Well, static builds are not something I would want to encourage, but it needs to be tested. Windows has the biggest issues with the whole dllexport/dllimport and .dll / .lib shenanigans, so I've added a separate MinGW build in 4e7d4c8810ef79dade0ee8ae18cd8a80b38e4526. The resulting packages are huge, but it covers MinGW and static builds at once.