Skip to content

Commit

Permalink
Add zipcode into process, make it closer to bazel build
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jan 21, 2025
1 parent b3bb0d3 commit a6570be
Show file tree
Hide file tree
Showing 5 changed files with 564 additions and 489 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "mozc"]
path = mozc
url = https://github.com/fcitx/mozc
[submodule "japanpost_zipcode"]
path = japanpost_zipcode
url = https://github.com/hiroyuki-komatsu/japanpost_zipcode
96 changes: 64 additions & 32 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,56 @@ mozc_library(file/recursive.cc DEPENDS absl::log mozc::base::file_util)
mozc_library(file/temp_dir.cc DEPENDS absl::log absl::statusor mozc::base::file_util mozc::base::file::recursive mozc::base::environ)
mozc_library(container/serialized_string_array.cc DEPENDS absl::log mozc::base::file_util)

file(GLOB KEYMAP_FILES ${MOZC_SOURCE_DIR}/data/keymap/*.tsv)
file(GLOB COMPOSITION_TABLES ${MOZC_SOURCE_DIR}/data/preedit/*.tsv)
set(COMPOSITION_TABLES
"12keys-halfwidthascii.tsv"
"12keys-hiragana.tsv"
"12keys-hiragana_intuitive.tsv"
"50keys-hiragana.tsv"
"flick-halfwidthascii.tsv"
"flick-halfwidthascii_ios.tsv"
"flick-hiragana.tsv"
"flick-hiragana_intuitive.tsv"
"flick-number.tsv"
"godan-hiragana.tsv"
"hiragana-romanji.tsv"
"kana.tsv"
"notouch-hiragana.tsv"
"qwerty_mobile-halfwidthascii.tsv"
"qwerty_mobile-hiragana.tsv"
"romanji-hiragana.tsv"
"toggle_flick-halfwidthascii.tsv"
"toggle_flick-halfwidthascii_ios.tsv"
"toggle_flick-hiragana.tsv"
"toggle_flick-hiragana_intuitive.tsv"
"toggle_flick-number.tsv"
)
list(TRANSFORM COMPOSITION_TABLES PREPEND ${MOZC_SOURCE_DIR}/data/preedit/)

set(KEYMAP_FILES
"atok.tsv"
"chromeos.tsv"
"kotoeri.tsv"
"mobile.tsv"
"ms-ime.tsv"
"overlay_henkan_muhenkan_to_ime_on_off.tsv")
list(TRANSFORM KEYMAP_FILES PREPEND ${MOZC_SOURCE_DIR}/data/keymap/)

mozc_python_gen_file(base/gen_config_file_stream_data.py
OUTPUTS config_file_stream_data.inc
INPUTS ${COMPOSITION_TABLES}
${KEYMAP_FILES}
${KEYMAP_FILES}
ARGS --output ${CMAKE_CURRENT_BINARY_DIR}/config_file_stream_data.inc
${COMPOSITION_TABLES}
${KEYMAP_FILES})
${COMPOSITION_TABLES}
${KEYMAP_FILES})
mozc_library(config_file_stream.cc
SOURCES
${CMAKE_CURRENT_BINARY_DIR}/config_file_stream_data.inc
DEPENDS
absl::raw_hash_set
absl::log
mozc::base::file_util
mozc::base::system_util
)
SOURCES
${CMAKE_CURRENT_BINARY_DIR}/config_file_stream_data.inc
DEPENDS
absl::raw_hash_set
absl::log
mozc::base::file_util
mozc::base::system_util
)
target_include_directories(base-config_file_stream PRIVATE ${PROJECT_BINARY_DIR})

mozc_library(mmap.cc DEPENDS absl::str_format absl::log absl::status absl::statusor)
Expand Down Expand Up @@ -61,17 +93,17 @@ mozc_python_gen_file(build_tools/mozc_version.py
OUTPUTS mozc_version.txt
INPUTS data/version/mozc_version_template.bzl
ARGS --template_path data/version/mozc_version_template.bzl
--output "${CMAKE_CURRENT_BINARY_DIR}/mozc_version.txt"
--target_platform=Linux
--output "${CMAKE_CURRENT_BINARY_DIR}/mozc_version.txt"
--target_platform=Linux
)
mozc_python_gen_file(build_tools/replace_version.py
OUTPUTS version_def.h
INPUTS ${CMAKE_CURRENT_BINARY_DIR}/mozc_version.txt
base/version_def_template.h
base/version_def_template.h
ARGS --version_file "${CMAKE_CURRENT_BINARY_DIR}/mozc_version.txt"
--input base/version_def_template.h
--output "${CMAKE_CURRENT_BINARY_DIR}/version_def.h"
--branding=Mozc
--input base/version_def_template.h
--output "${CMAKE_CURRENT_BINARY_DIR}/version_def.h"
--branding=Mozc
)

mozc_library(version.cc SOURCES ${CMAKE_CURRENT_BINARY_DIR}/version_def.h DEPENDS absl::log mozc::base::number_util)
Expand All @@ -80,24 +112,24 @@ target_include_directories(base-version PRIVATE ${PROJECT_BINARY_DIR})
mozc_python_gen_file(base/gen_character_set.py
OUTPUTS character_set.inc
INPUTS data/unicode/JIS0201.TXT
data/unicode/JIS0208.TXT
data/unicode/JIS0208.TXT
ARGS --jisx0201file=data/unicode/JIS0201.TXT
--jisx0208file=data/unicode/JIS0208.TXT
--output=${CMAKE_CURRENT_BINARY_DIR}/character_set.inc)
--jisx0208file=data/unicode/JIS0208.TXT
--output=${CMAKE_CURRENT_BINARY_DIR}/character_set.inc)
add_custom_target(character_set DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/character_set.inc)
set_target_properties(character_set PROPERTIES EXCLUDE_FROM_ALL TRUE)
mozc_library(strings
SOURCES
strings/internal/double_array.cc
strings/internal/japanese_rules.cc
strings/internal/utf8_internal.cc
strings/japanese.cc
strings/unicode.cc
DEPENDS absl::strings absl::log
)
SOURCES
strings/internal/double_array.cc
strings/internal/japanese_rules.cc
strings/internal/utf8_internal.cc
strings/japanese.cc
strings/unicode.cc
DEPENDS absl::strings absl::log
)
mozc_library(util.cc
DEPENDS absl::log absl::check mozc::base::strings
)
DEPENDS absl::log absl::check mozc::base::strings
)
add_dependencies(base-util character_set)
target_include_directories(base-util PRIVATE ${PROJECT_BINARY_DIR})
mozc_library(random.cc DEPENDS absl::random_random mozc::base::util)
Expand Down
Loading

0 comments on commit a6570be

Please sign in to comment.