Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 41 additions & 36 deletions docs/development/compiling-mesa-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: Complete guide for compiling Mesa graphics library for Universal Wi
slug: compiling-mesa-guide
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# How to Compile Mesa for UWP

This guide provides step-by-step instructions for compiling Mesa for the Universal Windows Platform (UWP). This process requires specific versions of tools and some environment configuration.
Expand All @@ -15,25 +18,7 @@ This guide provides step-by-step instructions for compiling Mesa for the Univers

Before you begin, you must install and configure the following software:

## Step 1: Download and Install Visual Studio 2022 Community

1. Visit the [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/) page.
2. Under "Community 2022", click the `Free download` button.
3. Once the installer is downloaded, open it to start the installation process.
4. In the Visual Studio Installer, select **Visual Studio Community 2022** and click `Install`.

1. When the installer prompts you to select the workloads, check the **Windows application development** workload:
- This includes the **Windows 11 SDK**, and **Windows app runtime**.

2. (Optional) You can also select other workloads depending on your needs, such as:
- `.NET Desktop Development` for WPF/WinForms applications.
- `Desktop development with C++` if you plan to work with C++ Win32 applications.

3. Under the **Individual Components** tab (if needed), ensure the following are checked:
- **C++ (v143) Universal Windows Platform tools**
- **Universal Windows Platform Tools**

4. Click `Install` to begin the installation process.
* **Visual Studio 2026 Community:** Installed with UWP workloads and components. Follow the [Visual Studio 2026 Setup Guide](/docs/helpful-links/visual-studio-2026-setup) for detailed installation instructions.

* **Git for Windows:**
* Download and install Git for Windows: [https://git-scm.com/downloads](https://git-scm.com/downloads). Accept the default installation options unless you have specific preferences.
Expand All @@ -46,7 +31,7 @@ Before you begin, you must install and configure the following software:
* **winflexbison:** A port of Flex and Bison for Windows.
* Download the `win_flex_bison-2.5.25.zip` from [this release page](https://github.com/lexxmark/winflexbison/releases/tag/v2.5.25).
* **Custom Meson Executable:** A specific version of the Meson executable is required for this build.
* Download the `meson.exe` from [this release page](https://github.com/SternXD/meson/releases/tag/1.3.99).
* Download the `meson.exe` from [this release page](https://github.com/SternXD/meson-uwp/releases/tag/uwp-1.11.2).
* **Required Python Packages:** You'll need to install a few packages using Python's package manager, pip.
* `pyyaml`
* `packaging`
Expand Down Expand Up @@ -94,37 +79,57 @@ To allow the system to find `meson`, `flex`, and `bison` from any command line,
3. Clone the repository using the following command:

```powershell
git clone -b uwp-25.3.3 https://github.com/SternXD/mesa-uwp.git
git clone -b uwp-26.2.0 https://github.com/SternXD/mesa-uwp.git
```
---

## 4. Compilation Process

1. Open a new **PowerShell** or **Windows Terminal** window.
1. Open a **Developer PowerShell for VS** or **x64 Native Tools Command Prompt for VS** (search for it in the Start Menu) so that the MSVC compiler environment and tools are loaded.

2. Navigate to the `mesa-uwp` directory you cloned earlier.
```powershell
cd C:\dev\mesa-uwp
```
3. **Setup the build.** Run the Meson setup command to generate the build files. This command creates a new directory named `build_release`.
* **For PowerShell:** (Note the backticks \` for line continuation)
```powershell
meson setup build_release --wipe --backend=vs --uwp --buildtype=release `
--prefix="C:\mesa_build" `
-Dcpp_std=vc++17 `
-Dc_args="-D_XBOX_UWP" `
-Dcpp_args="-D_XBOX_UWP" `
-Db_pch=false `
-Dc_winlibs="" `
-Dcpp_winlibs=""
```
3. **Compile the project.** Use the Meson compile command, pointing it to your build directory.

<Tabs>
<TabItem value="powershell" label="PowerShell" default>

```powershell
meson setup build_release --wipe --backend=vs --uwp --buildtype=release `
--prefix="C:\mesa_build" `
-Dcpp_std=vc++20 `
-Dc_args="-D_XBOX_UWP" `
-Dcpp_args="-D_XBOX_UWP" `
-Db_pch=false `
-Dc_winlibs="" `
-Dcpp_winlibs=""
```

</TabItem>
<TabItem value="cmd" label="Command Prompt (CMD)">

```cmd
meson setup build_release --wipe --backend=vs --uwp --buildtype=release ^
--prefix="C:\mesa_build" ^
-Dcpp_std=vc++20 ^
-Dc_args="-D_XBOX_UWP" ^
-Dcpp_args="-D_XBOX_UWP" ^
-Db_pch=false ^
-Dc_winlibs="" ^
-Dcpp_winlibs=""
```

</TabItem>
</Tabs>
4. **Compile the project.** Use the Meson compile command, pointing it to your build directory.
```powershell
meson compile -C build_release
```
4. **Install the compiled files.** This final step will copy the resulting libraries to your selected prefix e.g. `C:\mesa_build`
5. **Install the compiled files.** This final step will copy the resulting libraries to your selected prefix e.g. `C:\mesa_build`
```powershell
meson install -C build_release
```

Then it should all be done. By default, the final, usable files will be placed in `C:\mesa_build` (if you selected that for your prefix) in the `bin`, `include`, `lib`, and `share` directories.
Then it should all be done. By default, the final, usable files will be placed in `C:\mesa_build` (if you selected that for your prefix) in the `bin`, `include`, `lib`, and `share` directories.