Skip to content

Commit

Permalink
fix encoding problem 2
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Mar 1, 2023
1 parent ee587d4 commit 4fea5cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# These two files are encoded in Shift_JIS
add_library(ime_convert STATIC convert.cpp keychar.cpp)

# Workaround for Shift_JIS
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Shift_JIS for Clang/GCC
target_compile_options(ime_convert PRIVATE -finput-charset=CP932 -fexec-charset=CP932)
endif()
if(MSVC)
# Shift_JIS for Visual C++
target_compile_options(ime_convert PRIVATE /source-charset:shift_jis /execution-charset:shift_jis)
endif()

add_library(ime SHARED
cand_info.cpp
Expand All @@ -27,6 +33,11 @@ set_target_properties(ime PROPERTIES PREFIX "")
set_target_properties(ime PROPERTIES SUFFIX "")
set_target_properties(ime PROPERTIES OUTPUT_NAME "mzimeja.ime")

# UTF-8 for Visual C++
if(MSVC)
target_compile_options(ime PRIVATE /source-charset:utf-8 /execution-charset:utf-8 /validate-charset-)
endif()

# do statically link
set_target_properties(ime PROPERTIES LINK_DEPENDS_NO_SHARED 1)
set_target_properties(ime PROPERTIES LINK_SEARCH_START_STATIC 1)
Expand Down

0 comments on commit 4fea5cf

Please sign in to comment.