From 90b8f81a0210c0bdfc2b8d6263a195e261e3bef6 Mon Sep 17 00:00:00 2001 From: Smityz Date: Mon, 18 Dec 2023 15:29:50 +0800 Subject: [PATCH 1/7] add fs lib --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f76d30e6509..bfa6e044bd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,7 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY}) list(APPEND EXTERNAL_LIBS xxhash) list(APPEND EXTERNAL_LIBS span-lite) +list(APPEND EXTERNAL_LIBS stdc++fs) # Add git sha to version.h find_package(Git REQUIRED) From 132b81dfe955b4e10cdc0b92562deeb94d58d9c0 Mon Sep 17 00:00:00 2001 From: Smityz Date: Mon, 18 Dec 2023 16:46:15 +0800 Subject: [PATCH 2/7] update --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfa6e044bd2..6c4533f8c63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,7 +169,6 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY}) list(APPEND EXTERNAL_LIBS xxhash) list(APPEND EXTERNAL_LIBS span-lite) -list(APPEND EXTERNAL_LIBS stdc++fs) # Add git sha to version.h find_package(Git REQUIRED) @@ -260,4 +259,4 @@ file(GLOB_RECURSE TESTS_SRCS tests/cppunit/*.cc) add_executable(unittest ${TESTS_SRCS}) target_include_directories(unittest PRIVATE tests/cppunit) -target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock ${EXTERNAL_LIBS}) +target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock stdc++fs ${EXTERNAL_LIBS}) From c5936cbe8c362af26e89144334e0da72705275a7 Mon Sep 17 00:00:00 2001 From: Smityz Date: Mon, 18 Dec 2023 17:57:55 +0800 Subject: [PATCH 3/7] add condition --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c4533f8c63..736218d9278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,10 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY}) list(APPEND EXTERNAL_LIBS xxhash) list(APPEND EXTERNAL_LIBS span-lite) +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) +OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)) + list(APPEND EXTERNAL_LIBS stdc++fs) +endif() # Add git sha to version.h find_package(Git REQUIRED) @@ -258,5 +262,4 @@ target_link_libraries(kvrocks2redis PRIVATE kvrocks_objs ${EXTERNAL_LIBS}) file(GLOB_RECURSE TESTS_SRCS tests/cppunit/*.cc) add_executable(unittest ${TESTS_SRCS}) target_include_directories(unittest PRIVATE tests/cppunit) - -target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock stdc++fs ${EXTERNAL_LIBS}) +target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock ${EXTERNAL_LIBS}) From 3a677ad39be00750983b1349e4836d254163b9b6 Mon Sep 17 00:00:00 2001 From: Smityz Date: Mon, 18 Dec 2023 18:11:41 +0800 Subject: [PATCH 4/7] change condition --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 736218d9278..91d02879845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,10 +169,12 @@ list(APPEND EXTERNAL_LIBS Threads::Threads) list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY}) list(APPEND EXTERNAL_LIBS xxhash) list(APPEND EXTERNAL_LIBS span-lite) -if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) -OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) list(APPEND EXTERNAL_LIBS stdc++fs) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) + list(APPEND EXTERNAL_LIBS c++fs) +endif() # Add git sha to version.h find_package(Git REQUIRED) @@ -262,4 +264,4 @@ target_link_libraries(kvrocks2redis PRIVATE kvrocks_objs ${EXTERNAL_LIBS}) file(GLOB_RECURSE TESTS_SRCS tests/cppunit/*.cc) add_executable(unittest ${TESTS_SRCS}) target_include_directories(unittest PRIVATE tests/cppunit) -target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock ${EXTERNAL_LIBS}) +target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock stdc++fs ${EXTERNAL_LIBS}) From aa772fca975f935db7ae68f0743b0a97471f6bb4 Mon Sep 17 00:00:00 2001 From: Smityz Date: Mon, 18 Dec 2023 18:13:35 +0800 Subject: [PATCH 5/7] change condition --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91d02879845..dbab8de3d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,4 +264,4 @@ target_link_libraries(kvrocks2redis PRIVATE kvrocks_objs ${EXTERNAL_LIBS}) file(GLOB_RECURSE TESTS_SRCS tests/cppunit/*.cc) add_executable(unittest ${TESTS_SRCS}) target_include_directories(unittest PRIVATE tests/cppunit) -target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock stdc++fs ${EXTERNAL_LIBS}) +target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock ${EXTERNAL_LIBS}) From 8cca938f72e27fe004f7c4f7a113430872dc3100 Mon Sep 17 00:00:00 2001 From: Smityz Date: Tue, 19 Dec 2023 14:00:54 +0800 Subject: [PATCH 6/7] change condition --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbab8de3d5c..0a7dcadcbb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,6 @@ endif() find_package(Threads REQUIRED) list(APPEND EXTERNAL_LIBS glog) -list(APPEND EXTERNAL_LIBS snappy) list(APPEND EXTERNAL_LIBS rocksdb_with_headers) list(APPEND EXTERNAL_LIBS event_with_headers) list(APPEND EXTERNAL_LIBS lz4) @@ -173,7 +172,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_L list(APPEND EXTERNAL_LIBS stdc++fs) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) - list(APPEND EXTERNAL_LIBS c++fs) + if (NOT APPLE) + list(APPEND EXTERNAL_LIBS stdc++fs) + else() + list(APPEND EXTERNAL_LIBS c++fs) + endif() endif() # Add git sha to version.h From 750780b50e18663978480a6fd5c7a57de3fa3ebc Mon Sep 17 00:00:00 2001 From: Smityz Date: Tue, 19 Dec 2023 15:02:08 +0800 Subject: [PATCH 7/7] lint --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a7dcadcbb6..cbac9fdcc1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,4 +267,5 @@ target_link_libraries(kvrocks2redis PRIVATE kvrocks_objs ${EXTERNAL_LIBS}) file(GLOB_RECURSE TESTS_SRCS tests/cppunit/*.cc) add_executable(unittest ${TESTS_SRCS}) target_include_directories(unittest PRIVATE tests/cppunit) + target_link_libraries(unittest PRIVATE kvrocks_objs gtest_main gmock ${EXTERNAL_LIBS})