- For Windows platform and VS developers ONLY !!!
- You have to install Visual Studio, Intel C++ Compiler and MSYS2 (only for static builds) first.
- Download ICU source code package and extract it to anywhere you like.
- Open "<path_to_icu_source_code_directory>\source\allinone\allinone.sln" with Visual Studio.
- Switch to Intel C++ Compiler.
- Replace "/utf-8" with "-Qoption,cpp,--unicode_source_kind,"UTF-8"" in [Property->C/C++->Command line] (if there is no "/utf-8", it's OK, just add the latter one).
- Build the solution.
- Download ICU source code package and extract it to anywhere you like.
- Open "<path_to_icu_source_code_directory>\source\runConfigureICU", replace all "cl" with "icl", "-MD" with "-MT".
- Open "<path_to_icu_source_code_directory>\source\config\mh-msys-msvc" and do the following changes:
- find "ifeq ($(ENABLE_RELEASE),1)", add "CFLAGS+=-O2 -DU_RELEASE=1#M#" below it and change "CPPFLAGS+=-DU_RELEASE=1#M#" to "CPPFLAGS+=-O2 -DU_RELEASE=1#M#".
- find "ifeq ($(ENABLE_DEBUG),1)", add "CFLAGS+=-Od -D_DEBUG=1#M#" below it and change "CPPFLAGS+=-D_DEBUG=1#M#" to "CPPFLAGS+=-Od -D_DEBUG=1#M#".
- find "CFLAGS+=-GF -nologo -utf-8" and change it to "CFLAGS+=-GF -nologo -Zc:wchar_t -Qprec -Zm200 -Qoption,cpp,--unicode_source_kind,"UTF-8" -W3 -Qdiag-disable:673,809,1738,1744,3373".
- find "CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t -utf-8" and change it to "CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t -Qprec -Zm200 -Zc:forScope -Qstd=c++11 -Qoption,cpp,--unicode_source_kind,"UTF-8" -W3 -Qdiag-disable:673,809,1738,1744,3373".
- replace all "LINK.EXE" with "xilink", "LIB.EXE" with "xilib".
- Open cmd shell, execute the following commands:
Then execute the following commands:
rem the following paths may be different from your's, just for example call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\ipsxe-comp-vars.bat" ia32 vs2017 rem to build 64-bit icu: call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\ipsxe-comp-vars.bat" intel64 vs2017 call "C:\msys64\msys2_shell.cmd" -mingw32 -use-full-path rem to build 64-bit icu: call "C:\msys64\msys2_shell.cmd" -mingw64 -use-full-path
cd <path_to_icu_source_code_directory>/source ./runConfigureICU MSYS/MSVC --enable-static --disable-shared --prefix=$PWD/../../icu4c-x86-static-icc make -j4 && make install