Skip to content

Commit 3315638

Browse files
committed
ICU-13581 Update the ICU4C readme sections for building ICU on Windows with Visual Studio.
X-SVN-Rev: 41001
1 parent e18dd19 commit 3315638

File tree

2 files changed

+116
-63
lines changed

2 files changed

+116
-63
lines changed

Diff for: icu4c/icu4c.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,9 @@ td.proto {
500500
font-size: smaller;
501501
}
502502

503-
503+
.no-left-margin {
504+
margin-left: 0;
505+
}
504506

505507
@media print {
506508
div#toc {

Diff for: icu4c/readme.html

+113-62
Original file line numberDiff line numberDiff line change
@@ -787,25 +787,47 @@ <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
787787
<p>The steps are:</p>
788788

789789
<ol>
790-
<li>Unzip the icu-XXXX.zip file into any convenient location. Using command
791-
line zip, type "unzip -a icu-XXXX.zip -d drive:\directory", or just use
792-
WinZip.</li>
790+
<li>Unzip the <tt>icu-XXXX.zip</tt> file into any convenient location.<br/>
791+
<ul class="no-left-margin">
792+
<li>You can use the built-in zip functionality of Windows Explorer to do this.
793+
Right-click on the .zip file and choose the "Extract All" option from the context menu.
794+
This will open a new window where you can choose the output location to put the files.</li>
795+
<li>Alternatively, you can use a 3<sup>rd</sup> party GUI tool like 7-Zip or WinZip to do this as well.</li>
796+
</ul>
797+
</li>
793798

794-
<li>Be sure that the ICU binary directory, <i>&lt;ICU&gt;</i>\bin\, is
799+
<li>Be sure that the ICU binary directory, (ex: <i>&lt;ICU&gt;</i><tt>\bin\</tt>), is
795800
included in the <strong>PATH</strong> environment variable. The tests will
796-
not work without the location of the ICU DLL files in the path.</li>
801+
not work without the location of the ICU DLL files in the path.
802+
Note that the binary directory name can depend on what architecture you select when you compile ICU.
803+
For x86 or 32-bit builds, the binary directory is "<tt>bin</tt>". Whereas for x64 or 64-bit builds
804+
the binary directory is "<tt>bin64</tt>".
805+
</li>
797806

798-
<li>Open the "<i>&lt;ICU&gt;</i>\source\allinone\allinone.sln" workspace
807+
<li>Open the "<i>&lt;ICU&gt;</i><tt>\source\allinone\allinone.sln</tt>" solution
799808
file in Microsoft Visual Studio. (This solution includes all the
800809
International Components for Unicode libraries, necessary ICU building
801-
tools, and the test suite projects). Please see the <a href=
802-
"#HowToBuildWindowsCommandLine">command line note below</a> if you want to
810+
tools, and the test suite projects). Please see the
811+
<a href="#HowToBuildWindowsCommandLine">command line note below</a> if you want to
803812
build from the command line instead.</li>
804813

805-
<li>You may need to re-target the UWP projects to the version of the SDK that you have installed. In Visual Studio you can
806-
right-click on the UWP projects and select the option 'Retarget SDK Version'. Note: You do not need to have a copy of
807-
the Windows 10 SDK installed in order to build the non-UWP projects in Visual Studio. If the SDK is not installed then the
808-
UWP projects will simply not be loaded.</li>
814+
<li>You may need to "re-target" the 3 UWP projects (common_uwp, i18n_uwp, and makedata_uwp) to
815+
the version of the SDK that you have installed. In Visual Studio you can right-click on the
816+
UWP projects in the Solution Explorer and select the option 'Retarget Projects' from the context menu.
817+
This will open up a window where you can select the SDK version to target from a list of the
818+
various SDKs that are installed on the machine.
819+
<br/> Alternatively, you can manually edit the "<tt>*.vcxproj</tt>" files for the 3 UWP
820+
projects to change the value of the "<tt>WindowsTargetPlatformVersion</tt>" property to the
821+
version of the SDK that you would like to use instead.</li>
822+
<ul class="no-left-margin">
823+
<li>Note: You do <i>not</i> need to have a copy of the Windows 10 SDK installed in order
824+
to build the other (non-UWP) projects in Visual Studio. If the Windows 10 SDK is not
825+
installed then the UWP projects will not be loaded by Visual Studio.</li>
826+
<li>On Windows versions below Windows 10, the UWP projects will not load inside of the
827+
Visual Studio GUI. However, you can still build the UWP projects on the command line
828+
using <tt>MSBUILD</tt> instead. For more on this limitation see the Visual Studio 2017
829+
<a href="https://docs.microsoft.com/visualstudio/productinfo/vs2017-system-requirements-vs">release notes</a>.</li>
830+
</ul>
809831

810832
<li>Set the active platform to "Win32" or "x64" (See <a href="#HowToBuildWindowsPlatform">Windows platform note</a> below)
811833
and configuration to "Debug" or "Release" (See <a href="#HowToBuildWindowsConfig">Windows configuration note</a> below).</li>
@@ -814,62 +836,81 @@ <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
814836
build the Debug and Release at the same time, see the <a href=
815837
"#HowToBuildWindowsBatch">batch configuration note</a> below.</li>
816838

817-
818839
<li>Run the tests. They can be run from the command line or from within Visual Studio.
819840

820-
<h4>Running the Tests from the Windows Command Line (cmd)</h4>
821-
<ul>
822-
<li>For x86 (32 bit) and Debug, use: <br />
823-
824-
<tt><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <i>Platform</i> <i>Configuration</i>
825-
</tt> <br />
826-
</li>
827-
<li>So, for example:
828-
<br />
829-
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x86</b> <b>Debug</b></samp>
830-
or
831-
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x86</b> <b>Release</b></samp>
832-
or
833-
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x64</b> <b>Release</b></samp></li>
834-
</ul>
835-
836-
<h4>Running the Tests from within Visual Studio</h4>
837-
838-
<ol>
839-
<li>Run the C++ test suite, "intltest". To do this: set the active startup
840-
project to "intltest", and press Ctrl+F5 to run it. Make sure that it
841-
passes without any errors.</li>
842-
843-
<li>Run the C test suite, "cintltst". To do this: set the active startup
844-
project to "cintltst", and press Ctrl+F5 to run it. Make sure that it
845-
passes without any errors.</li>
846-
847-
<li>Run the I/O test suite, "iotest". To do this: set the active startup
848-
project to "iotest", and press Ctrl+F5 to run it. Make sure that it passes
849-
without any errors.</li>
841+
<h4>Running the Tests from the Windows Command Line (cmd)</h4>
842+
<ul>
843+
<li>The general syntax is:<br />
844+
<div class="indent">
845+
<tt><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <i>Platform</i> <i>Configuration</i></tt>
846+
</div>
847+
</li>
848+
<li>So, for example for x86 (32-bit) and Debug, use the following:<br />
849+
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x86</b> <b>Debug</b></samp>
850+
For x86 (32-bit) and Release:
851+
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x86</b> <b>Release</b></samp>
852+
For x64 (64-bit) and Debug:
853+
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x64</b> <b>Debug</b></samp>
854+
For x64 (64-bit) and Release:
855+
<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat <b>x64</b> <b>Release</b></samp>
856+
</li>
857+
</ul>
858+
859+
<h4>Running the Tests from within Visual Studio</h4>
850860

851-
</ol>
861+
<ol>
862+
<li>Run the C++ test suite, "<tt>intltest</tt>". To do this: set the active startup
863+
project to "intltest", and press Ctrl+F5 to run it. Make sure that it
864+
passes without any errors.</li>
865+
866+
<li>Run the C test suite, "<tt>cintltst</tt>". To do this: set the active startup
867+
project to "cintltst", and press Ctrl+F5 to run it. Make sure that it
868+
passes without any errors.</li>
852869

870+
<li>Run the I/O test suite, "<tt>iotest</tt>". To do this: set the active startup
871+
project to "iotest", and press Ctrl+F5 to run it. Make sure that it passes
872+
without any errors.</li>
873+
</ol>
853874
</li>
854875

855876
<li>You are now able to develop applications with ICU by using the
856-
libraries and tools in <i>&lt;ICU&gt;</i>\bin\. The headers are in
857-
<i>&lt;ICU&gt;</i>\include\ and the link libraries are in
858-
<i>&lt;ICU&gt;</i>\lib\. To install the ICU runtime on a machine, or ship
877+
libraries and tools in <tt><i>&lt;ICU&gt;</i>\bin\</tt>. The headers are in
878+
<tt><i>&lt;ICU&gt;</i>\include\</tt> and the link libraries are in
879+
<tt><i>&lt;ICU&gt;</i>\lib\</tt>. To install the ICU runtime on a machine, or ship
859880
it with your application, copy the needed components from
860-
<i>&lt;ICU&gt;</i>\bin\ to a location on the system PATH or to your
881+
<tt><i>&lt;ICU&gt;</i>\bin\</tt> to a location on the system PATH or to your
861882
application directory.</li>
862883
</ol>
863884

864885
<p><a name="HowToBuildWindowsCommandLine" id=
865-
"HowToBuildWindowsCommandLine"><strong>Using MSDEV At The Command Line
866-
Note:</strong></a> You can build ICU from the command line. Assuming that you
867-
have properly installed Microsoft Visual C++ to support command line
868-
execution, you can run the following command to build the 32-bit Release version:
869-
<code>'devenv.com <i>&lt;ICU&gt;</i>\source\allinone\allinone.sln /build "Release|Win32"'</code>.
870-
Or to build the 64-bit Release version from the command line:
871-
<code>'devenv.com <i>&lt;ICU&gt;</i>\source\allinone\allinone.sln /build "Release|x64"'</code>.
872-
<br />You can also use Cygwin with this compiler to build ICU, and you can refer to the <a href=
886+
"HowToBuildWindowsCommandLine"><strong>Using MSBUILD At The Command Line Note:</strong></a>
887+
You can build ICU from the command line instead of using the Visual Studio GUI.
888+
889+
Assuming that you have properly installed Visual Studio to support command line building, you
890+
should have a shortcut for the "Developer Command Prompt" listed in the Start Menu.
891+
(For Visual Studio 2017 you will need to install the "Desktop development with C++" option).</p>
892+
893+
<ul>
894+
<li>Open the "Developer Command Prompt" shortcut from the Start Menu. (This will open up a new command line window).</li>
895+
<li>From within the "Developer Command Prompt" change directory (<tt>cd</tt>) to the ICU source directory.</li>
896+
<li>You can then use either '<tt>msbuild</tt>' directly, or you can use the '<tt>devenv.com</tt>' command to build ICU.</li>
897+
<li>Using <tt>MSBUILD</tt>:</li>
898+
<ul class="no-left-margin">
899+
<li>To build the 32-bit Debug version, use the following command line:
900+
<code>'msbuild source\allinone\allinone.sln /p:Configuration=Debug /p:Platform=Win32'</code>.</li>
901+
<li>To build the 64-bit Release version, use the following command line:
902+
<code>'msbuild source\allinone\allinone.sln /p:Configuration=Release /p:Platform=x64'</code>.</li>
903+
</ul>
904+
<li>Using <tt>devenv.com</tt>:</li>
905+
<ul class="no-left-margin">
906+
<li>To build the 32-bit Debug version, use the following command line:
907+
<code>'devenv.com source\allinone\allinone.sln /build "Debug|Win32"'</code>.</li>
908+
<li>To build the 64-bit Release version, use the following command line:
909+
<code>'devenv.com source\allinone\allinone.sln /build "Release|x64"'</code>.</li>
910+
</ul>
911+
</ul>
912+
913+
<p>You can also use Cygwin with the MSVC compiler to build ICU, and you can refer to the <a href=
873914
"#HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a>
874915
section for more details.</p>
875916

@@ -907,6 +948,16 @@ <h4>Running the Tests from within Visual Studio</h4>
907948
Build...". Click the "Select All" button, and then click the "Rebuild"
908949
button.</p>
909950

951+
<p><a name="HowToUseOtherCompilerVersions" id="HowToUseOtherCompilerVersions">
952+
<strong>Building with other versions of MSVC Note:</strong></a> The particular version of the MSVC compiler
953+
that is used to compile ICU is determined by the "<tt>PlatformToolset</tt>" property in the various
954+
<tt>.vcxproj</tt> project files. <br/>For example, <code>&lt;PlatformToolset&gt;v140&lt;/PlatformToolset&gt;</code>
955+
corresponds to the Visual Studio 2015 compiler tool set, whereas <code>&lt;PlatformToolset&gt;v141&lt;/PlatformToolset&gt;</code>
956+
corresponds to the Visual Studio 2017 compiler tool set.
957+
However, using older versions of the MSVC compiler is generally not recommended due to the improved support for the C++11 standard
958+
in newer versions of the compiler. Older versions of the compiler have reduced support for various C++11 features, many of which
959+
are used by ICU.<br/></p>
960+
910961
<h3><a name="HowToBuildCygwin" href="#HowToBuildCygwin" id=
911962
"HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a></h3>
912963

@@ -916,7 +967,7 @@ <h3><a name="HowToBuildCygwin" href="#HowToBuildCygwin" id=
916967
<ul>
917968
<li>Microsoft Windows</li>
918969

919-
<li>Microsoft Visual C++ (from Visual Studio 2015 or newer, when gcc isn't used).</li>
970+
<li>Microsoft Visual C++ (from Visual Studio 2017 or newer, when gcc isn't used).</li>
920971

921972
<li>
922973
Cygwin with the following installed:
@@ -1619,13 +1670,13 @@ <h5>Linking on Solaris</h5>
16191670
<h3><a name="ImportantNotesWindows" href="#ImportantNotesWindows" id=
16201671
"ImportantNotesWindows">Windows Platform</a></h3>
16211672

1622-
<p>If you are building on the Win32 platform, it is important that you
1673+
<p>If you are building on the Windows platform, it is important that you
16231674
understand a few of the following build details.</p>
16241675

16251676
<h4>DLL directories and the PATH setting</h4>
16261677

16271678
<p>As delivered, the International Components for Unicode build as several
1628-
DLLs, which are placed in the "<i>&lt;ICU&gt;</i>\bin" directory. You must
1679+
DLLs, which are placed in the "<i>&lt;ICU&gt;</i>\bin64" directory. You must
16291680
add this directory to the PATH environment variable in your system, or any
16301681
executables you build will not be able to access International Components for
16311682
Unicode libraries. Alternatively, you can copy the DLL files into a directory
@@ -1635,12 +1686,12 @@ <h4>DLL directories and the PATH setting</h4>
16351686
<h4><a name="ImportantNotesWindowsPath" id=
16361687
"ImportantNotesWindowsPath">Changing your PATH</a></h4>
16371688

1638-
<p><strong>Windows 2000/XP</strong>: Use the System Icon in the Control
1689+
<p><strong>Windows 2000/XP and above</strong>: Use the System Icon in the Control
16391690
Panel. Pick the "Advanced" tab. Select the "Environment Variables..."
16401691
button. Select the variable PATH in the lower box, and select the lower
16411692
"Edit..." button. In the "Variable Value" box, append the string
1642-
";<i>&lt;ICU&gt;</i>\bin" to the end of the path string. If there is
1643-
nothing there, just type in "<i>&lt;ICU&gt;</i>\bin". Click the Set button,
1693+
";<i>&lt;ICU&gt;</i>\bin64" to the end of the path string. If there is
1694+
nothing there, just type in "<i>&lt;ICU&gt;</i>\bin64". Click the Set button,
16441695
then the OK button.</p>
16451696

16461697
<p>Note: When packaging a Windows application for distribution and

0 commit comments

Comments
 (0)