From a5baaad583c2731a31be07aef02774c69cb4f3ab Mon Sep 17 00:00:00 2001 From: Bambooin Date: Mon, 4 Sep 2023 11:50:42 +0800 Subject: [PATCH 1/3] fix: fix cmake conflict in yaml-cpp 0.8.0 CMake Error at librime/CMakeLists.txt:187 (add_custom_target): add_custom_target cannot create target "uninstall" because another target with the same name already exists. The existing target is a custom target created in source directory "github/trime/app/src/main/jni/librime/deps/yaml-cpp". See documentation for policy CMP0002 for more details. --- CMakeLists.txt | 4 ++-- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4117aed6..86232aa4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,12 +179,12 @@ if(NOT DEFINED BIN_INSTALL_DIR) endif() # } -# uninstall target +# remove target configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -add_custom_target(uninstall +add_custom_target(remove COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|DragonFly|GNU" OR MINGW) diff --git a/Makefile b/Makefile index 6f5c5f5fa..9d4f94ce6 100644 --- a/Makefile +++ b/Makefile @@ -73,10 +73,10 @@ install-debug: cmake --build $(build) --target install uninstall: - cmake --build $(build) --target uninstall + cmake --build $(build) --target remove uninstall-debug: - cmake --build $(build) --target uninstall + cmake --build $(build) --target remove test: release (cd $(build)/test; ./rime_test) From 1d29b896cddfbf431a0a049f8815977598089c30 Mon Sep 17 00:00:00 2001 From: Bambooin Date: Mon, 4 Sep 2023 11:55:07 +0800 Subject: [PATCH 2/3] chore: upgrade yaml-cpp to 0.8.0 --- deps/yaml-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/yaml-cpp b/deps/yaml-cpp index 0579ae3d9..f73201411 160000 --- a/deps/yaml-cpp +++ b/deps/yaml-cpp @@ -1 +1 @@ -Subproject commit 0579ae3d976091d7d664aa9d2527e0d0cff25763 +Subproject commit f7320141120f720aecc4c32be25586e7da9eb978 From 210f508fcbb80929513fc503c79a56ef5d0000e7 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Mon, 4 Sep 2023 18:09:01 -0400 Subject: [PATCH 3/3] fix yaml-cpp 0.8.0 build --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86232aa4d..b2b8eb74d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,9 @@ find_package(YamlCpp REQUIRED) if(YamlCpp_FOUND) include_directories(${YamlCpp_INCLUDE_PATH}) endif() +if(YamlCpp_STATIC) + add_definitions(-DYAML_CPP_STATIC_DEFINE) +endif() find_package(LevelDb REQUIRED) if(LevelDb_FOUND)