From b2f93f07f812898dfd984c941233d68bc545f5b4 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 8 Apr 2024 10:54:22 -0600 Subject: [PATCH] build: fix shared lib mode only (#104) Signed-off-by: Eduardo Silva --- src/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e66638..bb52273 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,7 +42,7 @@ endif() if (CIO_LIB_SHARED) add_library(chunkio-shared SHARED ${src}) - target_link_libraries(chunkio-static ${libs}) + target_link_libraries(chunkio-shared ${libs}) if(CIO_SANITIZE_ADDRESS) add_sanitizers(chunkio-shared) endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 0fe1845..f5bbd14 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,4 +2,9 @@ set(src cio.c) add_executable(cio ${src}) -target_link_libraries(cio chunkio-static) + +if (CIO_LIB_SHARED) + target_link_libraries(cio chunkio-shared) +elseif (CIO_LIB_STATIC) + target_link_libraries(cio chunkio-static) +endif() \ No newline at end of file