Skip to content

Commit

Permalink
build: merge rustlib and libime2
Browse files Browse the repository at this point in the history
  • Loading branch information
kanru committed Sep 7, 2024
1 parent ed83f3f commit 99ceabe
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions libIME/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libIME/CandidateWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions rustlib/Cargo.lock → libIME/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rustlib/Cargo.toml → libIME/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rustlib"
name = "libime2"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion libIME/NinePatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <string>

#include "rustlib_bridge/lib.h"
#include "libime2_bridge/lib.h"

using winrt::check_hresult;
using winrt::com_ptr;
Expand Down
2 changes: 1 addition & 1 deletion libIME/NinePatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <string>

#include "rustlib_bridge/lib.h"
#include "libime2_bridge/lib.h"

class NinePatch {
public:
Expand Down
File renamed without changes.

0 comments on commit 99ceabe

Please sign in to comment.