-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/CMakeLists.txt: fix static build
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: - http://autobuild.buildroot.org/results/eb7b73568ee4058f381c3e7c5634b1c5d92c3ca4 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
- Loading branch information
Showing
2 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/buffer ${CMAKE_BINARY_DIR}/src ${LIBEV_INCLUDE_DIR}) | ||
|
||
add_executable(example example.c) | ||
target_link_libraries(example uwsc ${LIBEV_LIBRARY}) | ||
if(BUILD_SHARED_LIBS) | ||
target_link_libraries(example uwsc ${LIBEV_LIBRARY}) | ||
else() | ||
target_link_libraries(example uwsc_s ${LIBEV_LIBRARY}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters