From 99ceabefb674a8cfa19334a484bc6a05b75ce5b0 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 7 Sep 2024 12:06:05 +0900 Subject: [PATCH] build: merge rustlib and libime2 --- libIME/CMakeLists.txt | 12 ++++++------ libIME/CandidateWindow.cpp | 2 +- {rustlib => libIME}/Cargo.lock | 20 ++++++++++---------- {rustlib => libIME}/Cargo.toml | 2 +- libIME/NinePatch.cpp | 2 +- libIME/NinePatch.h | 2 +- {rustlib => libIME}/src/lib.rs | 0 7 files changed, 20 insertions(+), 20 deletions(-) rename {rustlib => libIME}/Cargo.lock (99%) rename {rustlib => libIME}/Cargo.toml (92%) rename {rustlib => libIME}/src/lib.rs (100%) diff --git a/libIME/CMakeLists.txt b/libIME/CMakeLists.txt index 8753871..26f6a35 100644 --- a/libIME/CMakeLists.txt +++ b/libIME/CMakeLists.txt @@ -9,15 +9,15 @@ if(NOT Corrosion_FOUND) FetchContent_MakeAvailable(Corrosion) endif() -corrosion_import_crate(MANIFEST_PATH ../rustlib/Cargo.toml CRATES rustlib CRATE_TYPES staticlib) -corrosion_add_cxxbridge(rustlib_bridge - CRATE rustlib +corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES libime2 CRATE_TYPES staticlib) +corrosion_add_cxxbridge(libime2_bridge + CRATE libime2 FILES lib.rs ) -corrosion_add_target_rustflags(rustlib "-C target-feature=+crt-static") +corrosion_add_target_rustflags(libime2 "-C target-feature=+crt-static") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") - corrosion_set_env_vars(rustlib "CFLAGS=-EHsc" "CXXFLAGS=-EHsc") + corrosion_set_env_vars(libime2 "CFLAGS=-EHsc" "CXXFLAGS=-EHsc") endif() add_library(libIME_static STATIC @@ -58,7 +58,7 @@ add_library(libIME_static STATIC ) target_link_libraries(libIME_static - PUBLIC rustlib_bridge + PUBLIC libime2_bridge PUBLIC shlwapi.lib PUBLIC d2d1.lib PUBLIC d3d11.lib diff --git a/libIME/CandidateWindow.cpp b/libIME/CandidateWindow.cpp index 1967e49..2e9ac3a 100644 --- a/libIME/CandidateWindow.cpp +++ b/libIME/CandidateWindow.cpp @@ -38,7 +38,7 @@ #include "EditSession.h" #include "NinePatch.h" #include "TextService.h" -#include "rustlib_bridge/lib.h" +#include "libime2_bridge/lib.h" using namespace std; using winrt::check_hresult; diff --git a/rustlib/Cargo.lock b/libIME/Cargo.lock similarity index 99% rename from rustlib/Cargo.lock rename to libIME/Cargo.lock index 3216f21..0eb98f2 100644 --- a/rustlib/Cargo.lock +++ b/libIME/Cargo.lock @@ -40,6 +40,16 @@ dependencies = [ "syn", ] +[[package]] +name = "libime2" +version = "0.1.0" +dependencies = [ + "cxx", + "log", + "nine_patch_drawable", + "win_dbg_logger", +] + [[package]] name = "link-cplusplus" version = "1.0.9" @@ -79,16 +89,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rustlib" -version = "0.1.0" -dependencies = [ - "cxx", - "log", - "nine_patch_drawable", - "win_dbg_logger", -] - [[package]] name = "shlex" version = "1.3.0" diff --git a/rustlib/Cargo.toml b/libIME/Cargo.toml similarity index 92% rename from rustlib/Cargo.toml rename to libIME/Cargo.toml index 1004cda..9b3500b 100644 --- a/rustlib/Cargo.toml +++ b/libIME/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rustlib" +name = "libime2" version = "0.1.0" edition = "2021" diff --git a/libIME/NinePatch.cpp b/libIME/NinePatch.cpp index 65e373a..8b188a1 100644 --- a/libIME/NinePatch.cpp +++ b/libIME/NinePatch.cpp @@ -14,7 +14,7 @@ #include -#include "rustlib_bridge/lib.h" +#include "libime2_bridge/lib.h" using winrt::check_hresult; using winrt::com_ptr; diff --git a/libIME/NinePatch.h b/libIME/NinePatch.h index ef4f6f2..c082bb6 100644 --- a/libIME/NinePatch.h +++ b/libIME/NinePatch.h @@ -9,7 +9,7 @@ #include -#include "rustlib_bridge/lib.h" +#include "libime2_bridge/lib.h" class NinePatch { public: diff --git a/rustlib/src/lib.rs b/libIME/src/lib.rs similarity index 100% rename from rustlib/src/lib.rs rename to libIME/src/lib.rs