Skip to content

Commit

Permalink
Upgrade yaml-cpp to 0.8.0 (rime#705)
Browse files Browse the repository at this point in the history
* 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 <liumeo@pku.edu.cn>
  • Loading branch information
2 people authored and groverlynn committed Sep 27, 2023
1 parent 41c7776 commit a4eae87
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion deps/yaml-cpp
Submodule yaml-cpp updated 342 files

0 comments on commit a4eae87

Please sign in to comment.