From ef0b3ecf548dce8b4f1a28267ea2e2844a18a35d Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:17:48 +0800 Subject: [PATCH] feature support ULIB_SHARED_LIB --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f02bc1..19f3b2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,15 @@ set(FMT_USE_CPP11 OFF CACHE BOOL "Use C++11" FORCE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3party/fmt) option(ULIB_BUILD_TESTS "Build tests" OFF) +option(ULIB_SHARED_LIB "Build shared library" OFF) -add_library(${PROJECT_NAME} STATIC +if (ULIB_SHARED_LIB) + add_library(${PROJECT_NAME} SHARED "") +else() + add_library(${PROJECT_NAME} STATIC "") +endif() + +target_sources(${PROJECT_NAME} PRIVATE src/ulib/empty.cpp src/ulib/log/logger.cpp src/ulib/log/log.cpp