jbaldwin / libcoro

C++20 coroutine library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for shared library

uilianries opened this issue · comments

Hello!

I would like to understand the reason of supporting only static library libcoro.

https://github.com/jbaldwin/libcoro/blob/main/CMakeLists.txt#L130

add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES})

Could I use it as shared library locally, what should I know?

Regards!

Hi, just nobody has ever asked for it yet as far as I know. The library can add something similar to your other PR like LIBCORO_LIBRARY_SHARED=ON|OFF and it sets STATIC/SHARED on the line add_library line you identified. I think c-ares also needs to be switched to SHARED here https://github.com/jbaldwin/libcoro/blob/main/CMakeLists.txt#L49-L50 otherwise you'll get build errors.

Would you mind opening a PR with this to move it forward?

Would you mind opening a PR with this to move it forward?

Yes, I can open a PR, totally. Just asked first to be sure in case there was some restriction.

Thank you!