From c762bf8750cba15365707274be21f159a41b7247 Mon Sep 17 00:00:00 2001 From: Bambooin Date: Tue, 5 Sep 2023 06:41:08 +0800 Subject: [PATCH] Upgrade yaml-cpp to 0.8.0 (#705) * 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. * chore: upgrade yaml-cpp to 0.8.0 * fix yaml-cpp 0.8.0 build --------- Co-authored-by: Qijia Liu --- CMakeLists.txt | 7 +++++-- Makefile | 4 ++-- deps/yaml-cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4117aed61..b2b8eb74de 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) @@ -179,12 +182,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 6f5c5f5fa9..9d4f94ce6d 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) diff --git a/deps/yaml-cpp b/deps/yaml-cpp index 0579ae3d97..f732014112 160000 --- a/deps/yaml-cpp +++ b/deps/yaml-cpp @@ -1 +1 @@ -Subproject commit 0579ae3d976091d7d664aa9d2527e0d0cff25763 +Subproject commit f7320141120f720aecc4c32be25586e7da9eb978