Skip to content

Commit 25c8ffa

Browse files
committed
[docs] Clarify how to run cmake and llvm-lit with Visual Studio addressing PR45978
Differential Revision: https://reviews.llvm.org/D108444
1 parent eabb1f0 commit 25c8ffa

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

llvm/docs/GettingStartedVS.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ Here's the short story for getting up and running quickly with LLVM:
111111
you have the Visual Studio C++ Tools installed, not just Visual Studio
112112
itself (trying to create a C++ project in Visual Studio will generally
113113
download the C++ tools if they haven't already been).
114+
* Run cmake from a "x86/x64 Native Tools Command Prompt" so Visual C++ will
115+
be on the PATH and its environment variables are set. Do **not** use
116+
``CMAKE_C_COMPILER`` and ``CMAKE_CXX_COMPILER`` for this purpose:
117+
118+
.. code-block:: bat
119+
120+
**********************************************************************
121+
** Visual Studio 2019 Developer Command Prompt v16.11.1
122+
** Copyright (c) 2021 Microsoft Corporation
123+
**********************************************************************
124+
[vcvarsall.bat] Environment initialized for: 'x64'
125+
c:\build> cmake ..\llvm\llvm -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86 -Thost=x64
126+
114127
* See the :doc:`LLVM CMake guide <CMake>` for detailed information about
115128
how to configure the LLVM build.
116129
* CMake generates project files for all build types. To select a specific
@@ -144,7 +157,7 @@ Here's the short story for getting up and running quickly with LLVM:
144157

145158
* If ``%PATH%`` does not contain GnuWin32, you may specify
146159
``LLVM_LIT_TOOLS_DIR`` on CMake for the path to GnuWin32.
147-
* You can run LLVM tests by merely building the project "check". The test
160+
* You can run LLVM tests by merely building the project "check-all". The test
148161
results will be shown in the VS output window.
149162

150163
9. Test LLVM on the command line:
@@ -154,18 +167,18 @@ Here's the short story for getting up and running quickly with LLVM:
154167

155168
.. code-block:: bat
156169
157-
C:\..\llvm> python ..\build\bin\llvm-lit --param build_config=Win32 --param build_mode=Debug --param llvm_site_config=../build/test/lit.site.cfg test
170+
c:\llvm> python ..\build\Release\bin\llvm-lit.py llvm\test
158171
159172
This example assumes that Python is in your PATH variable, you
160-
have built a Win32 Debug version of llvm with a standard out of
173+
have built a Release version of llvm with a standard out of
161174
line build. You should not see any unexpected failures, but will
162175
see many unsupported tests and expected failures.
163176

164177
A specific test or test directory can be run with:
165178

166179
.. code-block:: bat
167180
168-
C:\..\llvm> python ..\build\bin\llvm-lit --param build_config=Win32 --param build_mode=Debug --param llvm_site_config=../build/test/lit.site.cfg test/path/to/test
181+
c:\llvm> python ..\build\Release\bin\llvm-lit.py llvm\test\Transforms\Util
169182
170183
171184
An Example Using the LLVM Tool Chain

0 commit comments

Comments
 (0)