# VS: Build Arm64X PE binary? (Windows 11 on Arm)

**URL:** https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447
**Category:** Development
**Tags:** os:windows, comp:msvc, gen:vs
**Created:** [July 26, 2025, 11:29am UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447 "2025-07-26T11:29:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kenjiuno](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kenjiuno/32/5691_2.png) [@kenjiuno](https://discourse.cmake.org/u/kenjiuno)
#### Post date: [July 26, 2025, 11:29am UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447/1 "2025-07-26T11:29:18Z")

</div>

Is there a plan to support the build of Arm64X PE binaries with the Visual Studio 17 2022 generator?

For example, the ODBC driver is better with an Arm64X PE binary.

MariaDB Connector/ODBC is a CMake-enabled project.

The 64-bit ODBC driver is installed at the following location.

`C:\Program Files\MariaDB\MariaDB ODBC Driver 64-bit\maodbc.dll`

- ODBC Administrator (Arm64) can load Arm64X `maodbc.dll`
- Microsoft Access (x64) can load Arm64X `maodbc.dll`

Windows 11 can share two 64-bit environments (Arm64 and x64) by having Arm64X binaries.

If CMake can support the build of Arm64X binaries more easily, it helps.

Although Microsoft introduces a workaround method, it is a very complex way.

[Build Arm64X Files | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/arm64x-build)

It is easier if sln & vcxprojs have both `ARM64` and `ARM64EC` platforms.

Arm64X PE binary is built on `ARM64EC` platform with `<PropertyGroup Condition="..."><BuildAsX>true</BuildAsX></PropertyGroup>`. Also `ARM64` platform is needed.

The output binary (DLL, EXE, LIB) from the `ARM64EC` platform is the final binary forming Arm64X.

OutDir and IntDir elements can be solved like the following sample:

```xml
    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">...\libmariadb\Release\ARM64\</OutDir>
    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">...\libmariadb\Release\</OutDir>
    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">libmariadb.dir\Release\ARM64\</IntDir>
    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">libmariadb.dir\Release\ARM64EC\</IntDir>

```

IntDir in utility projects is already ideal.

```xml
    <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|ARM64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
    <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|ARM64EC'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>

```

Object elements need to have a distinctive IntDir between ARM64 and ARM64EC. It is good to insert `$(Platform)\`.

```xml
<Object Include="V:\mariadb-connector-odbc-for-win10-arm64\arm64x-build\libmariadb\libmariadb\mariadb_obj.dir\$(Configuration)\$(Platform)\my_auth.obj" />

```

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [July 28, 2025, 3:00pm UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447/2 "2025-07-28T15:00:29Z")

</div>

No one is working on this AFAIK, but I’d welcome a contribution.

---

<div class="post-metadata">

### Author: ![kenjiuno](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kenjiuno/32/5691_2.png) [@kenjiuno](https://discourse.cmake.org/u/kenjiuno)
#### Post date: [July 31, 2025, 6:44am UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447/3 "2025-07-31T06:44:01Z")

</div>

For now, I have no idea how to implement these ideas in this CMake project.

But I could write some code. So I wrote a _converter_ instead of modifying the existing CMake generator.

[BuildHelper/BuildHelper/Program.cs at master · mariadb-connector-odbc-for-win10-arm64/BuildHelper](https://github.com/mariadb-connector-odbc-for-win10-arm64/BuildHelper/blob/master/BuildHelper/Program.cs)

Usage example:

```bat
V:\mariadb-connector-odbc-for-win10-arm64\BuildHelper\BuildHelper>dotnet run -- sln-clone-cp -u V:\mariadb-connector-odbc-for-win10-arm64\arm64x-build\libmariadb\external\zlib\zlib.sln * ARM64 ARM64EC

V:\mariadb-connector-odbc-for-win10-arm64\BuildHelper\BuildHelper>dotnet run -- sln-clone-cp -u V:\mariadb-connector-odbc-for-win10-arm64\arm64x-build\libmariadb\mariadb-connector-c.sln * ARM64 ARM64EC

V:\mariadb-connector-odbc-for-win10-arm64\BuildHelper\BuildHelper>dotnet run -- sln-clone-cp -u V:\mariadb-connector-odbc-for-win10-arm64\arm64x-build\mariadb_connector_odbc.sln * ARM64 ARM64EC

```

I’m also interested in whether someone else is having the same problem.

And please share if anyone has good ideas to build Arm64X binaries using CMake generator.

---

<div class="post-metadata">

### Author: ![DavidTruby](https://discourse.cmake.org/user_avatar/discourse.cmake.org/davidtruby/32/5848_2.png) [@DavidTruby](https://discourse.cmake.org/u/DavidTruby)
#### Post date: [October 10, 2025, 2:26pm UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447/4 "2025-10-10T14:26:42Z")

</div>

I’m also interested in this, not only for the Visual Studio generator but in general on Windows.

What’s needed is to build the library/binary as normal Arm64 and then again as Arm64EC, and then link it all together passing a `rsp` file to the linker. The process is outlined here: [Build Arm64X Files | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/arm64x-build) , but the way they’re suggesting doing it with CMake feels like a bit of a hack around this not being supported directly.

@brad.king would there be interest in accepting a patch providing some sort of direct Arm64X support? If so, what would you want this to look like, e.g. some sort of target property? I’m happy to give implementing it a go if it’d be likely to be accepted.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [October 10, 2025, 2:48pm UTC](https://discourse.cmake.org/t/vs-build-arm64x-pe-binary-windows-11-on-arm/14447/5 "2025-10-10T14:48:40Z")

</div>

@DavidTruby thanks. Please open [an issue](https://gitlab.kitware.com/cmake/cmake/-/issues) to propose the work in more detail.
