Following the instructions in https://learn.microsoft.com/en-us/windows/arm/arm64ec-build I can build a simple "hello world" CMake project using VS2022.
Issue is if I try to build on GitHub Actions I get:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
My yml is very simple
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
buildWindowsARM64EC:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Do stuff
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
cmake -B ${{github.workspace}}/build --preset arm64ec
cmake --build ${{github.workspace}}/build --config Release
shell: cmd
CMakePresets.json is also simple
{
"version": 5,
"configurePresets": [
{
"name": "base",
"hidden": true,
"generator": "Visual Studio 17 2022"
},
{
"name": "arm64ec",
"inherits": "base",
"displayName": "arm64ec",
"architecture": {
"value": "arm64ec",
"strategy": "set"
}
}
]
}
CMakeLists.txt:
cmake_minimum_required (VERSION 3.15)
project ("hello")
set(CMAKE_CXX_STANDARD 17)
set(Sources
main.cpp)
add_executable (${PROJECT_NAME} ${Sources})
I am guessing I am missing a PATH configuration or something similar but despite multiple iterations I can't seem to get any closer to it working.
The solution was in the end annoyingly simple.
Basically I needed to target a different SDK.
I added -DCMAKE_SYSTEM_VERSION=10 and all works fine
The yml is now simply:
With this it works as expected: