From 284bcf3972a46c71982acece0add5d1befffdfeb Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:10:16 +0800 Subject: [PATCH] fix duplicate library can't import --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c08f75a..34bcff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,13 @@ set(BUILD_UNIT_TESTS OFF) set(BUILD_EXAMPLES OFF) add_library(sled STATIC "") -add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL) -add_subdirectory(3party/fmt EXCLUDE_FROM_ALL) +if (NOT TARGET rpc_core) + add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL) +endif() + +if (NOT TARGET fmt) + add_subdirectory(3party/fmt EXCLUDE_FROM_ALL) +endif() # add_subdirectory(3party/eigen EXCLUDE_FROM_ALL) target_include_directories(sled PUBLIC 3party/eigen) target_sources(