@@ -61,6 +61,7 @@ check_include_files(sys/stat.h HAVE_SYS_STAT_H)
61
61
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
62
62
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
63
63
check_include_files(unistd.h HAVE_UNISTD_H)
64
+ check_include_files(windows.h HAVE_WINDOWS_H)
64
65
check_function_exists(getenv HAVE_GETENV)
65
66
check_function_exists(getpagesize HAVE_GETPAGESIZE)
66
67
check_function_exists(mmap HAVE_MMAP)
@@ -116,13 +117,22 @@ if(${CHARSET} STREQUAL "sjis")
116
117
foreach (flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
117
118
set (${flag} "${${flag} } -finput-charset=cp932 -fexec-charset=cp932" )
118
119
endforeach ()
120
+ target_compile_options (openjtalk
121
+ PRIVATE $<$<C_COMPILER_ID:MSVC >:/source -charset:.932;/execution-charset:.932>
122
+ )
119
123
elseif (${CHARSET} STREQUAL "eucjp" )
120
124
add_definitions (-DCHARSET_EUC_JP -DMECAB_CHARSET=euc-jp)
125
+ target_compile_options (openjtalk
126
+ PRIVATE $<$<C_COMPILER_ID:MSVC >:/source -charset:euc-jp;/execution-charset:euc-jp>
127
+ )
121
128
elseif (${CHARSET} STREQUAL "utf8" )
122
129
add_definitions (-DCHARSET_UTF_8 -DMECAB_CHARSET=utf-8 -DMECAB_UTF8_USE_ONLY)
123
130
foreach (flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
124
131
set (${flag} "${${flag} } -finput-charset=UTF-8 -fexec-charset=UTF-8" )
125
132
endforeach ()
133
+ target_compile_options (openjtalk
134
+ PRIVATE $<$<C_COMPILER_ID:MSVC >:/source -charset:UTF-8;/execution-charset:UTF-8>
135
+ )
126
136
else ()
127
137
message (FATAL_ERROR "Encoding ${CHARSET} not recognized. You can set sjis/eucjp/utf8" )
128
138
endif ()
0 commit comments