zhaojh329 / libuwsc

A Lightweight and fully asynchronous WebSocket client library based on libev
MIT License
289 stars 55 forks source link

src/CMakeLists.txt: fix static build #18

Closed ffontaine closed 4 years ago

ffontaine commented 4 years ago

Add BUILD_SHARED_LIBS and BUILD_STATIC_LIBS to allow the user to build a static only version otherwise build will fail on:

[ 93%] Building C object example/CMakeFiles/example.dir/example.c.o
[100%] Linking C executable example
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i686-buildroot-linux-uclibc/8.3.0/../../../../i686-buildroot-linux-uclibc/bin/ld: attempted static link of dynamic object `../src/libuwsc.so.3.3.2'
collect2: error: ld returned 1 exit status
example/CMakeFiles/example.dir/build.make:87: recipe for target 'example/example' failed

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com