[PATCH] D108444: [docs] Clarify how to run cmake and llvm-lit with Visual Studio addressing PR45978

Yaron Keren via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 22:29:02 PDT 2021


yaron.keren created this revision.
yaron.keren requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108444

Files:
  llvm/docs/GettingStartedVS.rst


Index: llvm/docs/GettingStartedVS.rst
===================================================================
--- llvm/docs/GettingStartedVS.rst
+++ llvm/docs/GettingStartedVS.rst
@@ -111,6 +111,19 @@
      you have the Visual Studio C++ Tools installed, not just Visual Studio
      itself (trying to create a C++ project in Visual Studio will generally
      download the C++ tools if they haven't already been).
+   * Run cmake from a "x86/x64 Native Tools Command Prompt" so Visual C++ will
+     be on the PATH and its environment variables are set. Do **not** use
+     ``CMAKE_C_COMPILER`` and ``CMAKE_CXX_COMPILER`` for this purpose:
+
+     .. code-block:: bat
+
+        **********************************************************************
+        ** Visual Studio 2019 Developer Command Prompt v16.11.1
+        ** Copyright (c) 2021 Microsoft Corporation
+        **********************************************************************
+        [vcvarsall.bat] Environment initialized for: 'x64'
+        c:\build> cmake ..\llvm\llvm -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86 -Thost=x64
+
    * See the :doc:`LLVM CMake guide <CMake>` for detailed information about
      how to configure the LLVM build.
    * CMake generates project files for all build types. To select a specific
@@ -144,7 +157,7 @@
 
    * If ``%PATH%`` does not contain GnuWin32, you may specify
      ``LLVM_LIT_TOOLS_DIR`` on CMake for the path to GnuWin32.
-   * You can run LLVM tests by merely building the project "check". The test
+   * You can run LLVM tests by merely building the project "check-all". The test
      results will be shown in the VS output window.
 
 9. Test LLVM on the command line:
@@ -154,10 +167,10 @@
 
      .. code-block:: bat
 
-        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
+        c:\llvm> python ..\build\Release\bin\llvm-lit.py llvm\test
 
      This example assumes that Python is in your PATH variable, you
-     have built a Win32 Debug version of llvm with a standard out of
+     have built a Release version of llvm with a standard out of
      line build. You should not see any unexpected failures, but will
      see many unsupported tests and expected failures.
 
@@ -165,7 +178,7 @@
 
      .. code-block:: bat
 
-        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
+        c:\llvm> python ..\build\Release\bin\llvm-lit.py llvm\test\Transforms\Util
 
 
 An Example Using the LLVM Tool Chain


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108444.367714.patch
Type: text/x-patch
Size: 2670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210820/1abd62f4/attachment.bin>


More information about the llvm-commits mailing list