[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
https://github.com/SamuelMarks created https://github.com/llvm/llvm-project/pull/93503 None >From bcdc355e9585e35f128a1b3ec71655d47bbf6986 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+samuelma...@users.noreply.github.com> Date: Tue, 28 May 2024 00:49:37 -0400 Subject: [PATCH] [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 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm -make +cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S ./llvm -B ./build +cmake --build ./build Note: For subsequent Clang development, you can just run make clang. CMake allows you to generate project files for several IDEs: Xcode, @@ -156,11 +154,9 @@ Using Visual Studio Run CMake to generate the Visual Studio solution and project files: cd llvm-project -mkdir build (for building without polluting the source dir) -cd build If you are using Visual Studio 2019: - cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm + cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S .\llvm -B .\build -Thost=x64 is required, since the 32-bit linker will run out of memory. To generate x86 binaries instead of x64, pass -A Win32. @@ -170,7 +166,7 @@ Using Visual Studio build directory. - Build Clang: + Build Clang (from Visual Studio's GUI): Open LLVM.sln in Visual Studio. Build the "clang" project for just the compiler driver and front end, or @@ -182,6 +178,10 @@ Using Visual Studio See Hacking on clang - Testing using Visual Studio on Windows for information on running regression tests on Windows. + Build Clang (from command-line using `cmake`) + + cmake --build .\build + Using Ninja alongside Visual Studio ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
@@ -67,15 +67,13 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm SamuelMarks wrote: @Endilll It saves two lines. Concision helps grokking https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
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+samuelma...@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 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm -make +cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S ./llvm -B ./build +cmake --build ./build Note: For subsequent Clang development, you can just run make clang. CMake allows you to generate project files for several IDEs: Xcode, @@ -156,11 +154,9 @@ Using Visual Studio Run CMake to generate the Visual Studio solution and project files: cd llvm-project -mkdir build (for building without polluting the source dir) -cd build If you are using Visual Studio 2019: - cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm + cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S .\llvm -B .\build -Thost=x64 is required, since the 32-bit linker will run out of memory. To generate x86 binaries instead of x64, pass -A Win32. @@ -170,7 +166,7 @@ Using Visual Studio build directory. - Build Clang: + Build Clang (from Visual Studio's GUI): Open LLVM.sln in Visual Studio. Build the "clang" project for just the compiler driver and front end, or @@ -182,6 +178,10 @@ Using Visual Studio See Hacking on clang - Testing using Visual Studio on Windows for information on running regression tests on Windows. + Build Clang (from command-line using `cmake`) + + cmake --build .\build + Using Ninja alongside Visual Studio >From 936d4b04dae51c560e0baf6e9384cec821b5d4fa Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+samuelma...@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 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project +mkdir build (in-tree build is not supported) +cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -S ./llvm -B ./build -cmake --build ./build +cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -GNinja ../llvm +cmake --build . Note: For subsequent Clang development, you can just run make clang. CMake allows you to generate project files for several IDEs: Xcode, @@ -154,9 +156,11 @@ Using Visual Studio Run CMake to generate the Visual Studio solution and project files: cd llvm-project +mkdir build (for building without polluting the source dir) +cd build If you are using Visual Studio 2019: - cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S .\llvm -B .\build + cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -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. @@ -178,9 +182,9 @@ Using Visual Studio See Hacking on clang - Testing using Visual Studio on Windows for information on running regression tests on Windows. - Build Clang (from command-line using `cmake`) + Alternatively, build Clang (from command-line using `cmake`) - c
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
@@ -67,15 +67,13 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm SamuelMarks wrote: Ok your call. I amended the patch. https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
@@ -74,8 +74,8 @@ On Unix-like Systems https://llvm.org/docs/CMake.html#frequently-used-cmake-variables";>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm SamuelMarks wrote: Oh I thought someone told me to use Ninja here in the docs I can revert. It's already referenced for Windows though - https://github.com/llvm/llvm-project/blob/12b0ef5dade664fb24cb4e627f1c391d937c0925/clang/www/get_started.html#L216 - still want the revert? https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits