11# Microsoft's C++ Standard Library
22
33This is the official repository for Microsoft's implementation of the C++ Standard Library (also known as the STL),
4- which ships as part of the MSVC toolset and the Visual Studio IDE. Our [ Changelog] [ ] tracks which updates to this
5- repository appear in each VS release.
4+ which ships as part of the MSVC toolset and the Visual Studio IDE.
5+
6+ * Our [ Changelog] [ ] tracks which updates to this repository appear in each VS release.
7+ * Our [ Status Chart] [ ] displays our overall progress over time.
8+ * Join our [ Discord server] [ ] .
69
710[ ![ Build Status] ( https://dev.azure.com/vclibs/STL/_apis/build/status/microsoft.STL?branchName=master )] [ Pipelines ]
811
@@ -147,30 +150,39 @@ acquire this dependency.
1471502 . Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
148151 ` https://github.com/microsoft/STL ` .
1491523 . Open a terminal in the IDE with `` Ctrl + ` `` (by default) or press on "View" in the top bar, and then "Terminal".
150- 4 . Invoke ` git submodule update --init vcpkg ` in the terminal.
151- 5 . Invoke ` .\vcpkg\bootstrap-vcpkg.bat ` in the terminal.
152- 6 . Invoke ` .\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows ` to install the boost-math dependency.
153+ 4 . In the terminal, invoke ` git submodule update --init vcpkg `
154+ 5 . In the terminal, invoke ` .\vcpkg\bootstrap-vcpkg.bat `
155+ 6 . In the terminal, invoke ` .\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows `
1531567 . Choose the architecture you wish to build in the IDE, and build as you would any other project. All necessary CMake
154157 settings are set by ` CMakeSettings.json ` .
155158
156159# How To Build With A Native Tools Command Prompt
157160
158- These instructions assume you're targeting ` x64-windows ` ; you can change this constant below to target other
159- architectures.
160-
1611611 . Install Visual Studio 2019 16.8 Preview 1 or later.
162162 * We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
163163 This will ensure that you're using supported versions of CMake and Ninja.
164164 * Otherwise, install [ CMake] [ ] 3.17 or later, and [ Ninja] [ ] 1.8.2 or later.
165- 2 . Open an "x64 Native Tools Command Prompt for VS 2019" .
165+ 2 . Open a command prompt .
1661663 . Change directories to a location where you'd like a clone of this STL repository.
167- 4 . Invoke ` git clone https://github.com/microsoft/STL `
168- 5 . Invoke ` cd STL `
169- 6 . Invoke ` git submodule update --init vcpkg `
170- 7 . Invoke ` .\vcpkg\bootstrap-vcpkg.bat `
171- 8 . Invoke ` .\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows ` to install the boost-math dependency.
172- 9 . Invoke ` cmake -G Ninja -S . -B {wherever you want binaries} ` to configure the project. For example, ` cmake -G Ninja -S . -B out\build\x64 `
173- 10 . Invoke ` ninja -C {wherever you want binaries} ` to build the project. For example, ` ninja -C out\build\x64 `
167+ 4 . ` git clone https://github.com/microsoft/STL `
168+ 5 . ` cd STL `
169+ 6 . ` git submodule update --init vcpkg `
170+ 7 . ` .\vcpkg\bootstrap-vcpkg.bat `
171+ 8 . ` .\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows `
172+
173+ To build the x86 target:
174+
175+ 1 . Open an "x86 Native Tools Command Prompt for VS 2019".
176+ 2 . Change directories to the previously cloned ` STL ` directory.
177+ 3 . ` cmake -G Ninja -S . -B out\build\x86 `
178+ 4 . ` ninja -C out\build\x86 `
179+
180+ To build the x64 target:
181+
182+ 1 . Open an "x64 Native Tools Command Prompt for VS 2019".
183+ 2 . Change directories to the previously cloned ` STL ` directory.
184+ 3 . ` cmake -G Ninja -S . -B out\build\x64 `
185+ 4 . ` ninja -C out\build\x64 `
174186
175187# How To Consume
176188
@@ -196,26 +208,26 @@ for DLL dependencies according to directories in the `PATH` environment variable
196208"x64 Native Tools Command Prompt for VS 2019":
197209
198210```
199- C:\Users\bion \Desktop>set INCLUDE=C:\Dev\STL\out\build\x64\out\inc;%INCLUDE%
211+ C:\Users\username \Desktop>set INCLUDE=C:\Dev\STL\out\build\x64\out\inc;%INCLUDE%
200212
201- C:\Users\bion \Desktop>set LIB=C:\Dev\STL\out\build\x64\out\lib\amd64;%LIB%
213+ C:\Users\username \Desktop>set LIB=C:\Dev\STL\out\build\x64\out\lib\amd64;%LIB%
202214
203- C:\Users\bion \Desktop>set PATH=C:\Dev\STL\out\build\x64\out\bin\amd64;%PATH%
215+ C:\Users\username \Desktop>set PATH=C:\Dev\STL\out\build\x64\out\bin\amd64;%PATH%
204216
205- C:\Users\bion \Desktop>type example.cpp
217+ C:\Users\username \Desktop>type example.cpp
206218#include <iostream>
207219
208220int main() {
209221 std::cout << "Hello STL OSS world!\n";
210222}
211223
212- C:\Users\bion \Desktop>cl /nologo /EHsc /W4 /WX /MDd /std:c++latest .\example.cpp
224+ C:\Users\username \Desktop>cl /nologo /EHsc /W4 /WX /MDd /std:c++latest .\example.cpp
213225example.cpp
214226
215- C:\Users\bion \Desktop>.\example.exe
227+ C:\Users\username \Desktop>.\example.exe
216228Hello STL OSS world!
217229
218- C:\Users\bion \Desktop>dumpbin /IMPORTS .\example.exe | findstr msvcp
230+ C:\Users\username \Desktop>dumpbin /IMPORTS .\example.exe | findstr msvcp
219231 msvcp140d_oss.dll
220232```
221233
@@ -244,29 +256,20 @@ under a category in libcxx, or running a single test in `std` and `tr1`.
244256
245257## Examples
246258
247- ```
248- :: This command will run all of the testsuites with verbose output.
249-
250- C:\STL\out\build\x64>ctest -V
251-
252- :: This command will also run all of the testsuites.
253-
254- C:\STL\out\build\x64>python tests\utils\stl-lit\stl-lit.py ..\..\..\llvm-project\libcxx\test ..\..\..\tests\std ..\..\..\tests\tr1
255-
256- :: This command will run all of the std testsuite.
257-
258- C:\STL\out\build\x64>python tests\utils\stl-lit\stl-lit.py ..\..\..\tests\std
259-
260- :: If you want to run a subset of a testsuite you need to point it to the right place in the sources. The following
261- :: will run the single test found under VSO_0000000_any_calling_conventions.
262-
263- C:\STL\out\build\x64>python tests\utils\stl-lit\stl-lit.py ..\..\..\tests\std\tests\VSO_0000000_any_calling_conventions
264-
265- :: You can invoke stl-lit with any arbitrary subdirectory of a testsuite. In libcxx this allows you to have finer
266- :: control over what category of tests you would like to run. The following will run all the libcxx map tests.
267-
268- C:\STL\out\build\x64>python tests\utils\stl-lit\stl-lit.py ..\..\..\llvm-project\libcxx\test\std\containers\associative\map
269- ```
259+ These examples assume that your current directory is ` C:\Dev\STL\out\build\x64 ` .
260+
261+ * This command will run all of the testsuites with verbose output.
262+ + ` ctest -V `
263+ * This command will also run all of the testsuites.
264+ + ` python tests\utils\stl-lit\stl-lit.py ..\..\..\llvm-project\libcxx\test ..\..\..\tests\std ..\..\..\tests\tr1 `
265+ * This command will run all of the std testsuite.
266+ + ` python tests\utils\stl-lit\stl-lit.py ..\..\..\tests\std `
267+ * If you want to run a subset of a testsuite, you need to point it to the right place in the sources. The following
268+ will run the single test found under VSO_0000000_any_calling_conventions.
269+ + ` python tests\utils\stl-lit\stl-lit.py ..\..\..\tests\std\tests\VSO_0000000_any_calling_conventions `
270+ * You can invoke ` stl-lit ` with any arbitrary subdirectory of a testsuite. In libcxx this allows you to have finer
271+ control over what category of tests you would like to run. The following will run all the libcxx map tests.
272+ + ` python tests\utils\stl-lit\stl-lit.py ..\..\..\llvm-project\libcxx\test\std\containers\associative\map `
270273
271274## Interpreting The Results Of Tests
272275
@@ -395,6 +398,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
395398[ Code of Conduct FAQ ] : https://opensource.microsoft.com/codeofconduct/faq/
396399[ Compiler Explorer ] : https://godbolt.org
397400[ Developer Community ] : https://developercommunity.visualstudio.com/spaces/62/index.html
401+ [ Discord server ] : https://discord.gg/XWanNww
398402[ How To Build With A Native Tools Command Prompt ] : #how-to-build-with-a-native-tools-command-prompt
399403[ How To Build With The Visual Studio IDE ] : #how-to-build-with-the-visual-studio-ide
400404[ LICENSE.txt ] : LICENSE.txt
@@ -408,6 +412,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
408412[ Pipelines ] : https://dev.azure.com/vclibs/STL/_build/latest?definitionId=2&branchName=master
409413[ Python ] : https://www.python.org/downloads/windows/
410414[ Roadmap ] : https://github.com/microsoft/STL/wiki/Roadmap
415+ [ Status Chart ] : https://microsoft.github.io/STL/
411416[ Wandbox ] : https://wandbox.org
412417[ bug tag ] : https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3Abug
413418[ cxx20 tag ] : https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3Acxx20
0 commit comments