[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)

Samuel Marks via cfe-commits cfe-commits at lists.llvm.org
Thu May 30 13:54:58 PDT 2024


https://github.com/SamuelMarks updated https://github.com/llvm/llvm-project/pull/93503

>From bcdc355e9585e35f128a1b3ec71655d47bbf6986 Mon Sep 17 00:00:00 2001
From: Samuel Marks <807580+SamuelMarks at users.noreply.github.com>
Date: Tue, 28 May 2024 00:49:37 -0400
Subject: [PATCH 1/2] [clang/www/get_started.html] Use newer `cmake` syntax
 (that also supports Windows)

---
 clang/www/get_started.html | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/clang/www/get_started.html b/clang/www/get_started.html
index 8e4d36640be73..1068246c23cc7 100755
--- a/clang/www/get_started.html
+++ b/clang/www/get_started.html
@@ -67,15 +67,13 @@ <h3 id="buildNix">On Unix-like Systems</h3>
   <li>Build LLVM and Clang:
   <ul>
     <li><tt>cd llvm-project</tt></li>
-    <li><tt>mkdir build</tt> (in-tree build is not supported)</li>
-    <li><tt>cd build</tt></li>
     <li>This builds both LLVM and Clang in release mode. Alternatively, if
         you need a debug build, switch Release to Debug. See
         <a href="https://llvm.org/docs/CMake.html#frequently-used-cmake-variables">frequently used cmake variables</a>
         for more options.
     </li>
-    <li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm</tt></li>
-    <li><tt>make</tt></li>
+    <li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S ./llvm -B ./build</tt></li>
+    <li><tt>cmake --build ./build</tt></li>
     <li>Note: For subsequent Clang development, you can just run
         <tt>make clang</tt>.</li>
     <li>CMake allows you to generate project files for several IDEs: Xcode,
@@ -156,11 +154,9 @@ <h3 id="buildWindows">Using Visual Studio</h3>
   <li>Run CMake to generate the Visual Studio solution and project files:
   <ul>
     <li><tt>cd llvm-project</tt></li>
-    <li><tt>mkdir build</tt> (for building without polluting the source dir)</li>
-    <li><tt>cd build</tt></li>
     <li>
       If you are using Visual Studio 2019:
-      <tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm</tt><br/>
+      <tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S .\llvm -B .\build</tt><br/>
       <tt>-Thost=x64</tt> is required, since the 32-bit linker will run out of memory.
     </li>
     <li>To generate x86 binaries instead of x64, pass <tt>-A Win32</tt>.</li>
@@ -170,7 +166,7 @@ <h3 id="buildWindows">Using Visual Studio</h3>
        <tt>build</tt> directory.
   </ul>
   </li>
-  <li>Build Clang:
+  <li>Build Clang (from Visual Studio's GUI):
   <ul>
     <li>Open LLVM.sln in Visual Studio.</li>
     <li>Build the "clang" project for just the compiler driver and front end, or
@@ -182,6 +178,10 @@ <h3 id="buildWindows">Using Visual Studio</h3>
   <li>See <a href="hacking.html#testingWindows">
      Hacking on clang - Testing using Visual Studio on Windows</a> for information
      on running regression tests on Windows.</li>
+  <li>Build Clang (from command-line using `cmake`)</li>
+  <ul>
+  <li><tt>cmake --build .\build</tt></li>
+  </ul>
 </ol>
 
 <h3 id="buildWindowsNinja">Using Ninja alongside Visual Studio</h3>

>From 936d4b04dae51c560e0baf6e9384cec821b5d4fa Mon Sep 17 00:00:00 2001
From: Samuel Marks <807580+SamuelMarks at users.noreply.github.com>
Date: Thu, 30 May 2024 16:54:35 -0400
Subject: [PATCH 2/2] [clang/www/get_started.html] Replace "Unix Makefiles"
 with "Ninja"; remove `-S ..\llvm -B .` shortcut as per reviewer requests

---
 clang/www/get_started.html | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/clang/www/get_started.html b/clang/www/get_started.html
index 1068246c23cc7..d1b00d0f04774 100755
--- a/clang/www/get_started.html
+++ b/clang/www/get_started.html
@@ -67,13 +67,15 @@ <h3 id="buildNix">On Unix-like Systems</h3>
   <li>Build LLVM and Clang:
   <ul>
     <li><tt>cd llvm-project</tt></li>
+    <li><tt>mkdir build</tt> (in-tree build is not supported)</li>
+    <li><tt>cd build</tt></li>
     <li>This builds both LLVM and Clang in release mode. Alternatively, if
         you need a debug build, switch Release to Debug. See
         <a href="https://llvm.org/docs/CMake.html#frequently-used-cmake-variables">frequently used cmake variables</a>
         for more options.
     </li>
-    <li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S ./llvm -B ./build</tt></li>
-    <li><tt>cmake --build ./build</tt></li>
+    <li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -GNinja ../llvm</tt></li>
+    <li><tt>cmake --build .</tt></li>
     <li>Note: For subsequent Clang development, you can just run
         <tt>make clang</tt>.</li>
     <li>CMake allows you to generate project files for several IDEs: Xcode,
@@ -154,9 +156,11 @@ <h3 id="buildWindows">Using Visual Studio</h3>
   <li>Run CMake to generate the Visual Studio solution and project files:
   <ul>
     <li><tt>cd llvm-project</tt></li>
+    <li><tt>mkdir build</tt> (for building without polluting the source dir)</li>
+    <li><tt>cd build</tt></li>
     <li>
       If you are using Visual Studio 2019:
-      <tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S .\llvm -B .\build</tt><br/>
+      <tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm</tt><br/>
       <tt>-Thost=x64</tt> is required, since the 32-bit linker will run out of memory.
     </li>
     <li>To generate x86 binaries instead of x64, pass <tt>-A Win32</tt>.</li>
@@ -178,9 +182,9 @@ <h3 id="buildWindows">Using Visual Studio</h3>
   <li>See <a href="hacking.html#testingWindows">
      Hacking on clang - Testing using Visual Studio on Windows</a> for information
      on running regression tests on Windows.</li>
-  <li>Build Clang (from command-line using `cmake`)</li>
+  <li>Alternatively, build Clang (from command-line using `cmake`)</li>
   <ul>
-  <li><tt>cmake --build .\build</tt></li>
+    <li><tt>cmake --build .</tt></li>
   </ul>
 </ol>
 



More information about the cfe-commits mailing list