File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,12 +8,20 @@ option(BUILD_TESTING "whether to build unit test" OFF)
88
99include (FetchContent )
1010set (FETCHCONTENT_QUIET OFF )
11- get_filename_component (fc_base "fc_base" REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
11+ get_filename_component (fc_base "fc_base- ${CMAKE_CXX_COMPILER_ID} " REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
1212set (FETCHCONTENT_BASE_DIR ${fc_base} )
1313list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /cmake)
1414
15- # Keep the same with openfst, -fPIC or -fpic
16- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -fPIC" )
15+ if (NOT MSVC )
16+ # Keep the same with openfst, -fPIC or -fpic
17+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -fPIC" )
18+ else ()
19+ # For windows, please use unicode(3 bytes per chinese char) instead of gbk(2 bytes per chinese char).
20+ # https://github.com/wenet-e2e/wenet/issues/882#issuecomment-1101246299
21+ set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
22+ add_compile_options ("$<$<CXX_COMPILER_ID :MSVC >:/utf -8>" )
23+ endif ()
24+
1725if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
1826 set (CMAKE_MACOSX_RPATH 1)
1927endif ()
You can’t perform that action at this time.
0 commit comments