Index: clang/www/get_started.html =================================================================== --- clang/www/get_started.html +++ clang/www/get_started.html @@ -127,23 +127,21 @@ -

If you encounter problems while building Clang, make sure that your LLVM -checkout is at the same revision as your Clang checkout. LLVM's interfaces -change over time, and mismatched revisions are not expected to work -together.

-

Simultaneously Building Clang and LLVM:

Once you have checked out Clang into the llvm source tree it will build along with the rest of llvm. To build all of LLVM and Clang together all at once simply run make from the root LLVM directory.

-

Note: Observe that Clang is technically part of a separate -Subversion repository. As mentioned above, the latest Clang sources are tied to -the latest sources in the LLVM tree. You can update your toplevel LLVM project -and all (possibly unrelated) projects inside it with make -update. This will run svn update on all subdirectories related -to subversion.

+

If you encounter problems while building Clang, make sure that your LLVM +checkout is at the same revision as your Clang checkout. LLVM's interfaces +change over time, and mismatched revisions are not expected to work +together. We recommend writing a script to automatically run svn up in +each repository to keep them synchronized. Alternatively, you may consider using +the unofficial +git monorepo +which automatically keeps everything in sync at the same revision and lets you +commit changes atomically across multiple LLVM subprojects.

Using Visual Studio

@@ -154,37 +152,37 @@
  • Get the required tools:
  • Check out LLVM:
  • Check out Clang:

    Note: Some Clang tests are sensitive to the line endings. Ensure that checking out the files does not convert LF line endings to CR+LF. @@ -195,11 +193,12 @@

  • cd ..\.. (back to where you started)
  • mkdir build (for building without polluting the source dir)
  • cd build
  • -
  • If you are using Visual Studio 2013: cmake -G "Visual Studio 12" ..\llvm
  • -
  • By default, the Visual Studio project files generated by CMake use the - 32-bit toolset. If you are developing on a 64-bit version of Windows and - want to use the 64-bit toolset, pass the ``-Thost=x64`` flag when - generating the Visual Studio solution. This requires CMake 3.8.0 or later.
  • +
  • + If you are using Visual Studio 2017: + cmake -G "Visual Studio 15 2017" -A x64 -Thost=x64 ..\llvm
    + -Thost=x64 is required, since the 32-bit linker will run out of memory. +
  • +
  • To generate x86 binaries instead of x64, pass -A Win32.
  • See the LLVM CMake guide for more information on other configuration options for CMake.
  • The above, if successful, will have created an LLVM.sln file in the @@ -224,6 +223,40 @@ to the latest code base, use the svn update command in both the llvm and llvm\tools\clang directories, as they are separate repositories.

    +

    Using Ninja alongside Visual Studio

    + +

    We recommend that developers who want the fastest incremental builds use the +Ninja build system. You can use the +generated Visual Studio project files to edit Clang source code and generate a +second build directory next to it for running the tests with these steps:

    + +
      +
    1. Check out clang and LLVM as described above
    2. +
    3. Open a developer command prompt with the appropriate environment. +
        +
      • If you open the start menu and search for "Command Prompt", you should + see shortcuts created by Visual Studio to do this. To use native x64 + tools, choose the one titled "x64 Native Tools Command Prompt for VS + 2017".
      • +
      • Alternatively, launch a regular cmd prompt and run the + appropriate vcvarsall.bat incantation. To get the 2017 x64 tools, this + would be:
        + "C:\Program Files (x86)\Microsoft Visual + Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 +
      • +
      +
    4. +
    5. mkdir build_ninja (or build, or use your own + organization)
    6. +
    7. cd build_ninja
    8. +
    9. set CC=cl (necessary to force CMake to choose MSVC over mingw GCC + if you have it installed)
    10. +
    11. set CXX=cl
    12. +
    13. cmake -GNinja ..\llvm
    14. +
    15. ninja clang This will build just clang.
    16. +
    17. ninja check-clang This will run the clang tests.
    18. +
    +

    Clang Compiler Driver (Drop-in Substitute for GCC)

    The clang tool is the compiler driver and front-end, which is